Google Sheets Formulas: 15 Essential Functions With Examples
Google Sheets formulas turn a spreadsheet into a working calculator, tracker or report. Start a formula with an equals sign (=), then combine cell references, operators and functions such as SUM, IF, COUNTIF and FILTER. The 15 examples below are designed to be copied into a practice sheet and adapted to your own data.

Google Sheets formulas cheat sheet
| Formula | What it does | Example |
|---|---|---|
| SUM | Adds numbers | =SUM(B2:B20) |
| AVERAGE | Calculates mean | =AVERAGE(B2:B20) |
| COUNT | Counts numeric cells | =COUNT(B2:B20) |
| COUNTA | Counts nonempty cells | =COUNTA(A2:A20) |
| IF | Returns one of two results | =IF(B2>=60,"Pass","Review") |
| SUMIF | Adds values matching one condition | =SUMIF(A2:A20,"Food",C2:C20) |
| COUNTIF | Counts cells matching a condition | =COUNTIF(B2:B20,"Done") |
| FILTER | Returns rows matching a condition | =FILTER(A2:C20,C2:C20>100) |
| SORT | Sorts a range | =SORT(A2:C20,3,FALSE) |
| UNIQUE | Returns distinct values | =UNIQUE(A2:A20) |
| IFERROR | Provides fallback for an error | =IFERROR(A2/B2,0) |
| TRIM | Removes extra ordinary spaces | =TRIM(A2) |
| TEXT | Formats a value as text | =TEXT(A2,"yyyy-mm-dd") |
| TODAY | Returns today’s date | =TODAY() |
| VLOOKUP | Looks up a value in a table | =VLOOKUP(E2,A2:C20,3,FALSE) |
These examples use commas between arguments. Some Google Sheets locales use semicolons instead; adjust separators if the sheet reports a formula parse error.
How to enter your first formula
- Open a spreadsheet in Google Sheets.
- Type a number such as
10in B2 and20in B3. - Click B4, type
=SUM(B2:B3)and press Enter. - The cell displays 30. Select it again to inspect or edit the underlying formula.
A formula is not the same as its displayed result. The cell may show 30, but the formula bar shows the calculation. If you change B2 from 10 to 15, B4 updates automatically to 35.
1. SUM: add a column of numbers
=SUM(C2:C50)Use SUM for revenue, expenses, quantities or scores. Unlike typing =C2+C3+C4, a range-based SUM is easier to maintain as the dataset grows. You can also combine separate ranges, for example =SUM(C2:C10,E2:E10).
2. AVERAGE: calculate a mean
=AVERAGE(D2:D31)AVERAGE calculates the arithmetic mean of numeric values. Blank cells and text do not count as numeric observations. A zero is a number, so it can lower the average. This distinction matters in attendance trackers and performance dashboards.
3. COUNT and COUNTA: count different kinds of entries
=COUNT(B2:B100)
=COUNTA(A2:A100)COUNT counts numeric cells. COUNTA counts nonempty cells, including text. If a column contains customer names, use COUNTA rather than COUNT. If you want to count only rows that meet a particular criterion, use COUNTIF instead.
4. IF: make decisions with a formula
=IF(C2>=100,"Target met","Below target")IF tests a condition and returns one result when true and another when false. Here a value of 100 or more displays “Target met.” You can also use IF for deadlines, inventory thresholds and status labels. Keep the condition simple before adding nested IF expressions.
5. COUNTIF: count tasks marked Done
=COUNTIF(D2:D100,"Done")COUNTIF counts how many cells in D2:D100 equal the text Done. This is useful for task lists and editorial workflows. To count numeric values over 100, use =COUNTIF(C2:C100,">100"); comparison expressions must be placed in quotation marks.
6. SUMIF: add amounts for one category
=SUMIF(A2:A100,"Food",C2:C100)Suppose column A stores expense categories and column C stores amounts. This adds values in column C only when the corresponding category in column A is Food. Make sure the criteria range and sum range line up row by row. For several conditions, learn SUMIFS.
7. SUMIFS: total a category within a date range
=SUMIFS(C2:C100,A2:A100,"Food",B2:B100,">="&DATE(2026,10,1),B2:B100,"<"&DATE(2026,11,1))This example totals Food expenses recorded during October 2026, assuming categories in A, actual date values in B and amounts in C. The exclusive upper boundary before November 1 is convenient when timestamps may be present. Ensure column B contains real dates, not date-like text.
8. FILTER: show only matching rows
=FILTER(A2:C100,C2:C100>100)FILTER returns rows whose column C values exceed 100. Unlike a regular filter menu, this produces a formula-generated result that updates when the source data changes. Leave enough blank cells below and to the right for the returned rows to expand. When no rows match, FILTER may return an error; you can use IFNA to show a friendly message.
9. SORT: order data by a numeric column
=SORT(A2:C100,3,FALSE)This returns a sorted view of the range, ordered by its third column in descending order. FALSE means descending here, which is different from FALSE in VLOOKUP. The meaning of an argument depends on the function. Sorting with a formula preserves the source table.
10. UNIQUE: remove repeated entries in a result
=UNIQUE(A2:A100)UNIQUE returns distinct values from the input. It is useful for creating a list of categories, authors or product IDs. It does not delete duplicates from the original cells. If entries differ by spaces or capitalization, consider cleaning the source first.
11. IFERROR: prevent a division error from breaking a report
=IFERROR(B2/C2,"Not available")If C2 is zero or another error occurs, this formula shows a readable message. However, IFERROR can also hide an accidental typo or invalid range. Use it deliberately and test the underlying calculation before masking errors.
12. TRIM: clean imported names and labels
=TRIM(A2)TRIM removes leading, trailing and repeated ordinary spaces from text. It is particularly helpful when names imported from a CSV do not match a lookup table. It does not remove every possible Unicode whitespace character, so some imported data needs additional cleanup.
13. TEXT: display dates in a consistent format
=TEXT(A2,"yyyy-mm-dd")TEXT converts the formatted result to a text string. Use it for display or exports, but remember that the result is text, not a numeric date. If you need to sort or calculate with dates, keep the original date cell as a real date and apply formatting rather than replacing it with text.
14. TODAY: display the current date
=TODAY()TODAY returns the current date according to the spreadsheet’s date and recalculation settings. A formula based on TODAY is useful for aging reports, deadlines and daily status checks. It is not a permanent timestamp: its result can change when the sheet recalculates on a later date.
15. VLOOKUP: find a value from a reference table
=VLOOKUP(E2,$A$2:$C$100,3,FALSE)This looks up the key in E2 in the first column of A2:C100 and returns the third column of the matching row. FALSE requests an exact match. The dollar signs lock the lookup range when the formula is copied. For more examples and fixes, see our VLOOKUP in Google Sheets guide.
Relative vs absolute references: A2, $A$2 and A$2
| Reference | When copied |
|---|---|
A2 | Row and column can change |
$A$2 | Row and column stay fixed |
$A2 | Column fixed; row can change |
A$2 | Row fixed; column can change |
Absolute and mixed references are essential for reusable budget models and dashboards. For example, if the tax rate lives in F1, a formula such as =B2*$F$1 can be copied down without shifting the rate cell.
Common Google Sheets formula errors
| Error | Typical reason | First thing to try |
|---|---|---|
#N/A | Lookup key not found | Check the lookup key and exact-match setting |
#REF! | Invalid reference or array result blocked | Check deleted cells and occupied output cells |
#DIV/0! | Division by zero | Check the denominator |
#VALUE! | Unexpected data type | Check text vs numbers |
| Formula parse error | Syntax or locale separator mismatch | Check parentheses, quotes and commas/semicolons |
How to choose the right function
If you want a total, use SUM. For a conditional total, use SUMIF or SUMIFS. To count status labels, use COUNTIF. To extract matching records, use FILTER. To find a value in another table, use VLOOKUP or XLOOKUP. To clean inconsistent imported text, use TRIM. These choices make formulas easier to understand and maintain than one giant nested expression.
Frequently asked questions
How do I start a formula in Google Sheets?
Type an equals sign followed by an expression or function, such as =A2+B2 or =SUM(A2:A10), then press Enter.
Why is my formula showing as text?
Check whether the cell was formatted as plain text or whether a leading apostrophe was entered. Re-enter the formula in an appropriate cell format if necessary.
Can Google Sheets formulas update automatically?
Yes. Most formulas recalculate when referenced values change. Some functions, including date-related functions, depend on recalculation settings.
Can I use Excel formulas in Google Sheets?
Many common formulas work similarly, but not every function or feature is identical. Test complex workbooks after importing them.
Official documentation
Google maintains a searchable Google Sheets function list and individual help pages with syntax details. To learn how to export a finished workbook, see our Google Sheets download guide. Practice with a small sample table before applying formulas to important business data.