Skip to content

    Formulas

    A cell that starts with = holds a formula. The engine works out the answer, shows it in the cell and keeps the formula. Formulas use cell references (A1, $A$1), ranges (A1:B4), operators and the functions below. Errors are values: they show in the cell and pass on to formulas that use the cell.

    Where to find it

    In a sheet cell, type a value that starts with =.

    How to add up a column

    1. Select the cell under the numbers.
    2. Type =SUM(B2:B6) and press Enter.

    How to use a suggestion

    1. Type = and the first letters of a function name.
    2. Press Tab to take the first suggestion. The name and ( are added.

    Options

    There are 62 functions in total: 48 in the FN table and 14 in the LAZY table.

    Control What it does Values Default
    operators Arithmetic, text join (&) and comparison. = <> < <= > >= & + - * / ^. Precedence: comparison 1, & 2, + - 3, * / 4, ^ 5.
    refs A cell or a range. A1, $A$1, A1:B2
    math Math functions. ABS, SUM, PRODUCT, POWER, SQRT, EXP, LN, LOG, LOG10, PI, ROUND, ROUNDUP, ROUNDDOWN, SUMPRODUCT
    stats Statistics functions. AVERAGE, COUNT, COUNTA, COUNTBLANK, MAX, MIN, MEDIAN, MODE, VAR, STDEV, PERCENTILE, CORREL
    logic Logic functions. NOT, AND, OR, ISBLANK, ISERROR, IF, IFS, IFERROR
    text Text functions. CONCAT, LEN, LEFT, RIGHT, UPPER, LOWER, VALUE
    date Date functions. DATE, DAYS, YEAR, MONTH, DAY
    finance Finance functions. RATE always returns #NUM!. FV, PV, PMT, NPER, RATE
    conditional Conditional functions. COUNTIF, COUNTIFS, SUMIF, SUMIFS, AVERAGEIF, AVERAGEIFS
    lookup Lookup functions. VLOOKUP, HLOOKUP, XLOOKUP, MATCH, INDEX
    errors Error values shown in the cell. #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM!, #N/A, #CYCLE!

    Keys

    Keys When What happens
    Tab Typing a function name with a suggestion Takes the suggestion
    Enter Typing Stores the formula and moves down
    Escape Typing Leaves the cell and keeps the old formula

    Limits

    • Numbers are read by spreadsheet rules. A blank cell is 0 in SUM. A value with % is divided by 100. A leading $, £, € or ฿ and commas are ignored. Text that is not a number gives #VALUE!.
    • RATE is not worked out. It returns #NUM!.
    • A formula that refers to itself through other cells gives #CYCLE!.
    • Deleting a row or column that a formula points at turns the reference into #REF!.
    • Sort is refused on a sheet that has formulas. See Sheet.

    See also