LocalExcelTool
Get started

Excel function cheat sheet (29)

One row per function: the syntax, what it returns, and a link to the worked example. Only about a dozen are worth memorising — XLOOKUP, SUMIF(S), COUNTIF(S), IF, IFERROR, TEXT and INDEX+MATCH. Look the rest up when you need them.

The same data drives the 29 detail pages, so this table and those pages cannot drift apart.

Lookup & reference12

FunctionSyntaxReturns
VLOOKUPVLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])The value in column N of the matched row; #N/A when an exact match is not found.
XLOOKUPXLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])The value at the matched position in return_array — or a whole row/column, which spills.
INDEXINDEX(array, row_num, [column_num])The value (or reference) at the intersection of the given row and column inside the range.
MATCHMATCH(lookup_value, lookup_array, [match_type])The position of the value inside the range — a number, or #N/A when it is not there.
HLOOKUPHLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])The value in row N of the matched column; #N/A when nothing matches.
OFFSETOFFSET(reference, rows, cols, [height], [width])A reference to the range reached by moving from the starting point.
INDIRECTINDIRECT(ref_text, [a1])The value or range that the text points at.
CHOOSECHOOSE(index_num, value1, [value2], ...)The value in position index_num of the argument list.
LOOKUPLOOKUP(lookup_value, lookup_vector, [result_vector])The value in result_vector at the position where lookup_vector matched.
ROWROW([reference])The row number of the reference; with no argument, the row of the formula itself.
COLUMNCOLUMN([reference])The column number of the reference (A=1, B=2…); with no argument, the current column.
TRANSPOSETRANSPOSE(array)The array with rows and columns swapped; it spills into neighbouring cells in Excel 365.

Logic8

FunctionSyntaxReturns
IFIF(logical_test, [value_if_true], [value_if_false])The value for the branch that applies — or FALSE if the third argument is left out.
IFSIFS(logical_test1, value1, [logical_test2, value2], ...)The value of the first condition that is true; #N/A if none of them is.
ANDAND(logical1, [logical2], ...)TRUE only when every condition is true; otherwise FALSE.
OROR(logical1, [logical2], ...)TRUE if any condition is true; FALSE only when all of them are false.
NOTNOT(logical)TRUE becomes FALSE and FALSE becomes TRUE.
IFERRORIFERROR(value, value_if_error)The value itself when it evaluates cleanly; the second argument when any error occurs.
IFNAIFNA(value, value_if_na)The value, unless it is #N/A — then the second argument. Other errors pass through.
SWITCHSWITCH(expression, value1, result1, [value2, result2], ..., [default])The result paired with the first value equal to the expression; the default, or #N/A, if nothing matches.

Math & conditional sums9

FunctionSyntaxReturns
SUMSUM(number1, [number2], ...)The total of the numbers in all arguments; text, booleans and empty cells are ignored.
SUMIFSUMIF(range, criteria, [sum_range])The total of sum_range across the rows that meet one condition.
SUMIFSSUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)The total of sum_range across the rows that meet every condition.
SUMPRODUCTSUMPRODUCT(array1, [array2], ...)The sum of the products of corresponding items; with one array, the sum of that array.
ROUNDROUND(number, num_digits)The number rounded to the given number of decimal places.
ROUNDUPROUNDUP(number, num_digits)The number rounded away from zero, whatever the digits are.
ROUNDDOWNROUNDDOWN(number, num_digits)The number truncated toward zero.
INTINT(number)The largest integer less than or equal to the number, rounding toward negative infinity.
MODMOD(number, divisor)The remainder after division, with the sign of the divisor.

Turn the data into a workbook

Exports from other systems arrive as text instead of numbers, with blank rows and three fields crammed into one column. Fix those before writing formulas, or every formula has to work around them.