Formulas and Functions

Calculate from your cells, with the functions Google Sheets, Excel and OpenDocument know.

Writing a formula

Start a cell with = and write what to calculate: =B2*1.21, =SUM(B2:B10) or =IF(C2>100, "Large", "Small"). Press Enter to save it; the cell shows the answer and the formula bar shows the formula.

  • While you type, click a cell or drag over a range to put its reference in at the caret, or move to it with the arrow keys. Each reference and the range it names share a colour.
  • Function names complete as you type: Tab or Enter takes the one offered. Tools > Suggestion Controls turns the offers off.
  • A formula that cannot be read is not saved: the cell stays open with what is wrong under it, such as a missing ).

References

  • A1 names a cell and A1:C10 a range; A:A is a whole column and 2:2 a whole row.
  • Sheet2!A1 reads a cell of another sheet, and 'Sales 2026'!B4 one whose name has spaces. Renaming a sheet rewrites the formulas that name it.
  • A $ keeps a part of a reference fixed when the formula is copied or filled: $A$1 stays put, A$1 keeps its row. Press F4 in a formula to step through them.

Insert Function

Insert > Function, or the Σ button on the toolbar, lists SUM, AVERAGE, COUNT, MAX and MIN first, then All the functions and each category: Array, Database, Date, Engineering, Filter, Financial, Google, Info, Logical, Lookup, Math, Operator, Parser, Statistical, Text, Web, OpenFormula and Plan Cards.

  • With one cell selected, the function starts in it, such as =SUM(, for you to finish.
  • With a range of cells selected, it starts in the cell below, already reading the range: =SUM(B2:B6).
  • While you are writing a formula, it goes in where the caret is.

The function help card

As you type a function, a card under the cell names what it takes, what it does and an example. F1 hides the card and shows it again. Point at a cell showing an error such as #DIV/0! or #REF! to read what went wrong.

Arrays

A function that answers with more than one value, such as FILTER, SORT, UNIQUE or SEQUENCE, fills the cells below and beside it. If something is in the way, the cell shows #REF! until there is room. Ctrl+Shift+Enter wraps a formula in ARRAYFORMULA, so =A1:A3*2 works on every row of the range.

LAMBDA and LET name values inside a formula, and MAP, REDUCE, SCAN, BYROW and BYCOL run a LAMBDA over a range.

Showing formulas

View > Show > Formulas (Ctrl+`) shows every formula in its cell instead of its answer. It changes only your own view.

Named ranges

Data > Named Ranges gives a range a name, such as TaxRate or Orders, to use in formulas in its place: =B2*TaxRate. The names belong to the whole spreadsheet, and the name box lists them to jump to.

Named functions

Data > Named Functions saves a formula of your own as a function, with its arguments and a description, such as PRICE_WITH_TAX(price). It is offered as you type, like any other function, and Import Function brings in the named functions of another of your spreadsheets.

How functions answer

The functions answer as Google Sheets' do. A spreadsheet opened from an Excel or OpenDocument file keeps that file's answer where the two differ, so its numbers never change by opening it here. The few functions that depend on Google's own services, such as GOOGLEFINANCE and GOOGLETRANSLATE, are not run: a file using them keeps the values it last showed.

IMPORTRANGE reads a range of another LiveDoc spreadsheet you can open, and the Plan Cards functions (CARDCOUNT, CARDSUM, CARD and CARDS) read the cards of the Plan document named in File > Settings.

Was this article helpful?