Sub topic 1
Starting a formula with =
Prerequisites
This chapter assumes you can do three things:
- Open a Google Sheets spreadsheet and move around in it.
- Type values into cells and edit them.
- Use the basic arithmetic operators
+,-,*, and/.
You do not need to know any functions yet. Later chapters build on what you learn here: A1 notation, relative and absolute references, ranges, and references to other sheets.
What the equals sign does
When you type into a cell, Google Sheets decides what kind of content it is. If the first character is =, Sheets treats everything after it as a formula. A formula is an instruction that Sheets evaluates, and the cell then shows the result instead of the text you typed. Anything else is a constant, a value stored exactly as entered, such as 42, Total, or 2026-11-27.
The two behave differently:
| You type | Sheets stores | The cell shows |
|---|---|---|
| `12` | The number 12 | 12 |
| `12+8` | The text "12+8" | 12+8 |
| `=12+8` | A formula | 20 |
| `=B2*C2` | A formula that reads two cells | The product of B2 and C2 |
The second row catches many beginners. Without the leading =, the cell contains plain text. Sheets will not calculate it, and you will not get an error to tell you so.
Formula versus result
A formula cell has two layers:
- The formula is what you typed. You see it in the formula bar when you select the cell.
- The result is the value the formula currently produces. You see it in the cell.
The result is not stored permanently. Sheets recalculates it whenever a cell the formula depends on changes. This is the main reason to use formulas. If you type 20 where =12+8 would do, you must update it by hand when the inputs change. A formula that points at cells updates itself.
Your first formula
Suppose a small order sheet looks like this:
| Row | A | B | C | D |
|---|---|---|---|---|
| 1 | Item | Price | Quantity | Line total |
| 2 | Notebook | 4 | 10 | |
| 3 | Pen | 1.5 | 20 |
To fill the first line total, select D2 and type this:
=B2*C2Press Enter. D2 shows 40, because B2 holds 4 and C2 holds 10. The text B2 and C2 are cell references. They tell Sheets to use whatever value is in those cells at calculation time. A reference is not a copy of the value. If you change B2 to 5, D2 changes to 50 immediately.
The next chapter covers how references are written. For now, treat B2 as "the cell in column B, row 2".
Building a formula by clicking
You do not have to type the references. After typing = in D2, click B2. Sheets inserts B2 in the formula and highlights the cell with a colored border. Type *, click C2, and press Enter. The result is the same, and you avoid typos in the reference.
While you edit, each reference in the formula is shown in its own color, and the matching cell gets a border of that color. This is a quick way to check that a formula points where you think it does.
Operators
Formulas combine values with operators. These are the ones you will use most:
| Operator | Meaning | Example | Result |
|---|---|---|---|
| `+` | Add | `=2+3` | 5 |
| `-` | Subtract | `=10-4` | 6 |
| `*` | Multiply | `=3*4` | 12 |
| `/` | Divide | `=9/2` | 4.5 |
| `^` | Power | `=2^3` | 8 |
| `%` | Percent | `=50%` | 0.5 |
| `&` | Join text | `="Total: "&40` | Total: 40 |
| `=` `<>` `<` `>` `<=` `>=` | Compare | `=5>3` | TRUE |
A comparison returns TRUE or FALSE. You will use these results mostly inside functions such as IF.
The = sign appears in two roles. The leading = marks the cell as a formula. A later = inside the formula is a comparison. So ==5=5 is not valid, but =5=5 is, and it returns TRUE.
Order of evaluation
Sheets does not simply read left to right. It follows a fixed precedence, from highest to lowest:
- Parentheses
- Percent (
%) - Power (
^) - Multiplication and division
- Addition and subtraction
- Text joining (
&) - Comparisons
Operators at the same level are evaluated left to right. This means =2+3*4 returns 14, not 20. Use parentheses to force the order you want:
=(2+3)*4This returns 20. When in doubt, add parentheses. They cost nothing and make the intent clear to the next person who reads the formula.
Values inside formulas
A formula can mix references with literal values. Three kinds of literal appear often:
- Numbers, written plainly:
=B2*1.2. - Text, written in double quotes:
="Order for "&A2. - Booleans, written as
TRUEorFALSE, without quotes.
Text needs straight double quotes ("). If you paste a formula from a document or web page, the quotes may be curly (“ ”). Sheets then reports a parse error because curly quotes are not string delimiters. Retype the quotes by hand to fix it.
Hardcoding numbers that may change, such as a tax rate typed as 1.2, makes a sheet hard to maintain. Later chapters show how to keep such values in their own cell and point to them with absolute references or named ranges.
Functions
A function is a named calculation. You call it by writing its name, then its inputs, called arguments, in parentheses and separated by commas:
=SUM(B2:B10)This adds the values in B2 through B10. Function names are not case sensitive, so =sum(b2:b10) works the same way, and Sheets converts it to uppercase for you.
Functions and operators can be combined in one formula. =SUM(B2:B3)*2 adds first, then doubles the result.
Autocomplete and help
When you type = followed by letters, Sheets offers matching function names. Press Tab or Enter to accept a suggestion. After you type the opening parenthesis, a small help box shows the arguments the function expects and highlights the one you are on. Use it when you are not sure about the order of arguments.
Argument separators depend on locale
In many regions, Sheets uses a semicolon instead of a comma between arguments, and a comma instead of a period as the decimal mark. This depends on the spreadsheet's locale, found under File, Settings. Examples in this tutorial use commas. If a formula that works in one spreadsheet fails in another, check the locale before you suspect the formula.
Editing and viewing formulas
These actions cover most day-to-day work:
- Edit a formula: select the cell and press F2, or double-click it. You can also change it in the formula bar.
- Cancel an edit: press Esc. The cell keeps its previous content.
- Commit an edit: press Enter, or Tab to move right.
- See every formula at once: use View, then Show, then Formulas. The keyboard shortcut is Ctrl+
(Cmd+on Mac). Run it again to switch back to results.
Viewing all formulas is useful when you inherit a sheet and want to see which cells are calculated and which are typed in.
Common problems when starting a formula
The formula appears as text
You typed =B2*C2, but the cell shows =B2*C2 instead of a number. There are two usual causes:
- The cell's format is set to Plain text. Sheets then stores whatever you type as text, even if it starts with
=. Change the format with Format, then Number, then Automatic, and retype the formula. - A leading apostrophe or a leading space was entered. An apostrophe tells Sheets to store the entry as text. A space means the first character is no longer
=.
You want to type a literal equals sign
To enter text that begins with =, such as a note showing a formula as an example, type an apostrophe first: '=B2*C2. The apostrophe is not displayed, and the cell holds text.
A quick error check
If a new formula returns an error code, read the code before changing anything:
| Message | Usual cause at this stage |
|---|---|
| `#ERROR!` (parse error) | Unbalanced parentheses, curly quotes, or a wrong separator for the locale |
| `#NAME?` | A misspelled function name, or text outside quotes that Sheets reads as a name |
| `#DIV/0!` | Division by zero or by an empty cell |
| `#VALUE!` | An operation on text that cannot be read as a number |
A later chapter covers #REF!, #NAME?, and #DIV/0! in detail. The point here is that each message names a different kind of problem, so the code is your first clue.
Numbers stored as text
A reference to a cell that looks like a number but is stored as text can give #VALUE! or a wrong total. Numbers stored as text are usually left-aligned by default, while real numbers are right-aligned. If a calculation seems off, check how the input cells are aligned and formatted.
Summary of the working model
- A leading
=turns the entry into a formula. Without it, the entry is a constant. - The cell shows the result, and the formula bar shows the formula.
- References such as
B2read the current value of a cell, so results update when inputs change. - Operators follow a fixed order, and parentheses override it.
- Text must be in straight double quotes.
- The cell format and the spreadsheet locale can change how a formula is read.
Exercise
In cell D2 you type =B2+C2*2, where B2 holds 10 and C2 holds 3. What does D2 show, and how would you rewrite the formula so that B2 and C2 are added first and then doubled?
Show answer
D2 shows 16, because multiplication happens before addition: C22 is 6, and 10+6 is 16. To add first and then double, use parentheses: `=(B2+C2)2`, which gives 26.
Exercise
You type =B2*C2 into a cell, press Enter, and the cell displays the text =B2*C2 instead of a number. Name two possible causes and how to fix each.
Show answer
The cell may be formatted as Plain text, so fix it by setting the format to Automatic and retyping the formula. The entry may also start with an apostrophe or a space, so the first character is not =. Remove the extra character and enter the formula again.