How to Use Formulas in Google Sheets

How to Use Formulas in Google Sheets

Start a formula by typing '=' in a cell, then use function names and cell references; press Enter to apply. Use relative references by default and add the $ symbol to lock cells for absolute references. Test formulas with sample data and read error messages; follow the troubleshooting checklist below to resolve common issues.

Basic formula syntax and a quick start

Google Sheets evaluates formulas that begin with an equals sign. A formula can be a simple calculation, a built-in function call, or a combination of both. The minimal, practical steps to create and apply a formula are:

  1. Click a cell and type =.
  2. Enter a function or expression (for example, =SUM(A2:A10) or =A2*B2).
  3. Press Enter. The cell shows the result; the formula is visible in the formula bar.

Additional tips that save time:

Relative vs absolute references: when and why to lock cells

Cell references tell a formula which values to use. By default references are relative, meaning they change when you copy the formula to another cell. Use absolute references to keep a reference fixed.

Key reference types:

Use relative references for repeating calculations across rows or columns (for example, computing row totals). Use absolute references for constants like tax rates or lookup table anchors. For a deeper explanation and examples, see Relative vs absolute cell references.

Common functions and a worked example: SUM, AVERAGE, VLOOKUP and INDEX-MATCH

Google Sheets includes many functions. Below are practical uses and a worked example to compare VLOOKUP and INDEX-MATCH.

Worked example: customer lookup from a product table

Scenario: you have a table where column A is Product ID, column B is Product Name, column C is Price, and you want to retrieve Price by Product ID entered in cell F2.

  1. VLOOKUP method: in G2 enter =VLOOKUP(F2, A2:C100, 3, FALSE). This searches the leftmost column of A2:C100 for the value in F2 and returns the third column (Price).
  2. INDEX-MATCH method: in G2 enter =INDEX(C2:C100, MATCH(F2, A2:A100, 0)). MATCH finds the row where Product ID equals F2; INDEX returns the corresponding Price from C2:C100.

Why choose INDEX-MATCH? It works when the lookup column is not the leftmost, and it can be slightly more reliable across range changes. For more on array-style operations that sometimes replace repeated lookups, see Array formulas explained.

Array formulas: perform calculations across ranges at once

Array formulas return or operate on multiple values with a single formula. They are useful when one formula should populate several rows or columns or when you want to avoid copying formulas repeatedly.

Common patterns:

Array formulas change how results are placed; a single cell can output a vertical or horizontal array of values. Because the behavior is different from single-cell formulas, test on a duplicate sheet before converting many formulas.

Error handling and troubleshooting

Errors are common when building formulas. Google Sheets displays error types such as #DIV/0!, #N/A, #REF!, #VALUE!, and #ERROR. Read the provided message in the error tooltip — it often points directly to the problem.

Short troubleshooting checklist:

  1. Check parentheses and commas. A missing closing parenthesis causes parse errors.
  2. Verify ranges contain the expected data types (numbers vs text).
  3. Confirm lookup ranges include the lookup column and are not misaligned.
  4. If you see #N/A, the lookup key was not found; consider using IFNA to provide a fallback, e.g., =IFNA(VLOOKUP(...), "Not found").
  5. Use error-checking wrappers: IFERROR(expression, value_if_error) gives a clean fallback instead of an error.

When an error persists, consult a focused guide: Fix common formula errors for step-by-step diagnostics and examples.

Practical step-by-step: build, test, and deploy a formula

  1. Plan the expected inputs and outputs on paper or in a draft sheet.
  2. Write the simplest formula that returns a correct result for one row or case, then confirm output.
  3. Expand the formula using ranges or ARRAYFORMULA when you need it to apply across rows.
  4. Lock references with $ where required so copying the formula preserves constants.
  5. Validate results with known values, and add IFERROR or IFNA to handle missing data gracefully.
  6. Document nonobvious formulas with a nearby comment or a legend sheet explaining assumptions.

Common mistakes and quick fixes

Closing: apply formulas with intent and test early

Formulas are tools to automate calculations and reduce repetitive work. Start simple, test with sample data, and expand gradually. Keep a short checklist handy when you encounter an error, and use absolute references or array formulas to control how a formula behaves when copied. For deeper reference on cell locking, error fixes, or arrays, follow the internal guides linked above.