Writing a formula in Google Sheets is as simple as clicking a cell, typing an equals sign (=), and then entering the calculation or function you want. For example, to add the numbers in cells A1 and B1, click C1, type =A1+B1, and press Enter. This guide walks you through the exact steps, from basic arithmetic to using built-in functions like SUM and IF, with common mistakes and troubleshooting tips.
What You’ll Need
- A Google account (free) and access to Google Sheets in a web browser.
- A spreadsheet with some data, or a blank sheet to practice on.
- Basic familiarity with clicking cells and typing in the formula bar (the bar above the column letters).
Step-by-Step
- Open Google Sheets and create or open a spreadsheet. Go to sheets.google.com, sign in, and either click a blank sheet or open an existing file.
- Select the cell where you want the result to appear. Click any cell, for example C1. The cell will be highlighted with a border.
- Type the equals sign (
=) to start the formula. Every formula in Google Sheets must begin with=. Without it, Google Sheets treats your input as text, not a formula. - Enter your calculation or function. You can type a simple arithmetic expression like
=A1+B1or use a function like=SUM(A1:A10). Functions are pre-built formulas that perform specific tasks. For example,=AVERAGE(B2:B20)calculates the average of numbers in that range. - Press Enter on your keyboard. Google Sheets calculates the result and displays it in the selected cell. The formula itself remains visible in the formula bar when you click the cell again.
- Use cell references instead of typing numbers directly. Instead of
=5+10, type=A1+B1. This way, if you change the value in A1 or B1, the formula automatically recalculates. To reference a cell, you can type its column letter and row number (e.g., A1) or click the cell while writing the formula. - Use ranges for multiple cells. A range is a group of cells, written as
start:end, likeA1:A10. For example, to add all numbers in column A from row 1 to row 10, type=SUM(A1:A10). - Combine functions with operators. You can mix functions and arithmetic. For instance, to add the sum of A1:A5 to the value in B1, type
=SUM(A1:A5)+B1. Use parentheses to control order:=(A1+B1)*C1multiplies the sum by C1. - Use comparison operators for logical tests. Symbols like
>(greater than),<(less than), and=(equal to) let you compare values. For example,=A1>10returns TRUE if A1 is greater than 10, otherwise FALSE. - Write an IF function for conditional logic. The IF function checks a condition and returns one value if true, another if false. Syntax:
=IF(condition, value_if_true, value_if_false). For example, with a score in A1,=IF(A1>=60, "Pass", "Fail")returns “Pass” if the score is 60 or above, and “Fail” otherwise. - Drag the fill handle to copy formulas. After entering a formula, click the cell again. You’ll see a small blue square in the bottom-right corner. Click and drag it down or across to copy the formula to adjacent cells. Google Sheets automatically adjusts cell references relative to the new location (e.g., copying
=A1+B1from C1 to C2 changes it to=A2+B2). - Use absolute references when needed. If you don’t want a reference to change when copying, add dollar signs:
$A$1locks both column and row. For example, to multiply each value in column A by a fixed tax rate in B1, use=A2*$B$1in C2 and copy down.
Common Mistakes
- Forgetting the equals sign. Typing
A1+B1without the=results in text, not a calculation. - Using the wrong cell reference. Double-check that you’re referencing the correct cells, especially when copying formulas.
- Mismatched parentheses. Every opening parenthesis must have a closing one. Google Sheets usually warns you with a red error message.
- Using commas instead of colons in ranges. A range is
A1:A10, notA1,A10(which would mean two separate cells). - Typing text without quotes in functions. In IF, text values must be in double quotes:
"Pass", not justPass. - Mixing up argument separators. In Google Sheets, use commas to separate arguments (e.g.,
=IF(A1>10, "Yes", "No")). Some regions use semicolons, but the default is comma.
Tips
- Start with the function wizard. Click a cell, type
=, and then type a letter (likes) to see a dropdown of functions. Select one to see its syntax and description. - Use the formula bar for editing. Click a cell with a formula, then edit it in the formula bar above the spreadsheet. Press Enter to apply changes.
- Learn common functions first. SUM, AVERAGE, COUNT, MAX, MIN, and IF cover most basic needs. For example,
=COUNT(A1:A10)counts how many cells contain numbers. - Use keyboard shortcuts. Press
Enterto confirm a formula,Escto cancel, andF2(orCtrl+Enteron Mac) to edit the active cell. - Test on a small dataset. Before applying a formula to hundreds of rows, try it on a few cells to verify the logic.
- Use named ranges for clarity. Select a range, go to Data > Named ranges, and give it a name like
Sales. Then you can write=SUM(Sales)instead of=SUM(A1:A100).
Troubleshooting
- Formula shows as text. If you see the formula as plain text, you likely forgot the equals sign. Click the cell, add
=at the beginning, and press Enter. - #ERROR! or #DIV/0! appears. This means the formula can’t be calculated. Common causes: dividing by zero (
=A1/B1where B1 is 0), or a typo in the function name. Check the formula and the referenced cells. - #NAME? error. This usually means you misspelled a function name or used text without quotes. For example,
=SUMM(A1:A10)should be=SUM(A1:A10), and=IF(A1>10, Yes, No)should have quotes around Yes and No. - #REF! error. This means a reference is invalid, often because a column or row was deleted. Click the cell, check the formula, and update the references.
- Formula not updating when I change data. Google Sheets recalculates automatically, but if you see stale results, try pressing
Ctrl+R(Windows) orCmd+R(Mac) to refresh the page. Also ensure the cell is not formatted as text. - Wrong result with IF. Double-check the condition and the true/false values. For example,
=IF(A1>10, "High", "Low")returns “High” if A1 is greater than 10, otherwise “Low”. If the result seems reversed, check the comparison operator.
Frequently Asked Questions
- Can I use formulas across different sheets in the same spreadsheet? Yes. Reference a sheet by name, like
=Sheet2!A1. If the sheet name has spaces, use single quotes:='My Sheet'!A1. - How do I add a column of numbers quickly? Click the cell below the column, type
=SUM(, then select the range (e.g., A1:A10), close the parenthesis, and press Enter. Or use the shortcutAlt+Shift+=(Windows) orCmd+Shift+T(Mac) to insert a SUM automatically. - What’s the difference between a formula and a function? A formula is any expression that starts with
=, like=A1+B1. A function is a predefined formula, like=SUM(A1:A10). All functions are formulas, but not all formulas use functions. - Can I use text in formulas? Yes. Enclose text in double quotes, like
="Total: "&A1which concatenates the text “Total: ” with the value in A1. The ampersand (&) is the concatenation operator. - How do I copy a formula without changing references? Use absolute references with dollar signs, like
$A$1. Alternatively, copy the formula text from the formula bar and paste it into another cell. - Why does my formula show a green triangle warning? This is a Google Sheets error indicator. Click the cell to see the warning, which often says “Formula parse error” or “Inconsistent formula.” Review the formula and fix the issue, such as a missing parenthesis or a range that doesn’t match adjacent formulas.
Related
- How to Write Dates in Google Sheets
- Google Sheets QUERY: How to Write and Use the Function
- Google Sheets IF Else: How to Write Conditional Formulas
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- SUMIF Checkbox in Google Sheets: Sum Checked RowsIf your checkboxes are in A2:A20 and the values to add are in B2:B20, use =SUMIF(A2:A20,TRUE,B2:B20) to total…
- Paste Values Shortcut in Excel (Windows & Mac)The fastest shortcut to paste values only in Excel for Windows is Ctrl+Alt+V, then V, then Enter. On…
- How to Insert a Horizontal Line in a Word DocumentTo add a quick divider in Word for Microsoft 365 on Windows, type three hyphens (—) on a…
- Can You Align Shapes in Excel? A Practical Guide to LayoutYes. In Excel for Microsoft 365 on Windows, select two or more shapes, then choose Shape Format >…
- How to Delete Duplicate Entries in ExcelTo delete duplicate entries in Excel for Microsoft 365 on Windows, select the full data range, choose Data…
- Excel Remove Duplicates: Is Matching Case-Sensitive?No. In Excel for Microsoft 365 on Windows, Data > Remove Duplicates treats text that differs only by…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.