ThisCalculator

Everyday

How to Write a Formula in Excel: Beginner’s Guide

Updated · Standard formula, shown below

This guide walks you through writing your first Excel formula, from understanding cell references to using functions like SUM and AVERAGE. You’ll learn the syntax, how to copy formulas safely, and how to fix common errors. By the end, you’ll be able to build simple calculations that update automatically when your data changes.

What You’ll Need

  • A computer with Microsoft Excel installed (any recent version works, including Excel for Microsoft 365, Excel 2019, or Excel for Mac).
  • A basic spreadsheet with some numbers you want to calculate – or you can follow along with a blank sheet.
  • No prior formula experience is required, but knowing how to click cells and type in them helps.

Step-by-Step

  1. Open Excel and click on a cell where you want the result to appear. For example, click cell B2.
  2. Type the equals sign (=) – every formula must start with this. Without it, Excel treats your entry as text or a number.
  3. Enter your calculation using numbers, cell references (like A1 or C5), and operators (+, -, *, /). For instance, to add the values in cells A1 and A2, type =A1+A2.
  4. Press Enter to finish. The result appears in the cell, and the formula itself shows in the Formula Bar when you click the cell.
  5. Use a function for common tasks – instead of typing =A1+A2+A3, type =SUM(A1:A3). Functions are pre-built formulas like SUM, AVERAGE, and COUNT. You can start typing =SUM( and Excel will suggest the syntax.
  6. Reference ranges with a colon – a range like A1:A3 means “all cells from A1 to A3.” This is much faster than listing each cell.
  7. Copy the formula to other cells – click the cell with the formula, then drag the small square at the bottom-right corner (the fill handle) down or across. Excel adjusts cell references automatically (see Tips).
  8. Edit a formula – double-click the cell, or click it and edit in the Formula Bar, then press Enter.
  9. Check the result – after entering, verify the number makes sense. If it looks wrong, review your cell references and operators.

Common Mistakes

  • Forgetting the equals sign – typing A1+A2 without “=” will show the text “A1+A2” instead of a result.
  • Mismatched parentheses – every opening parenthesis needs a closing one. Excel usually warns you, but it’s easy to miss in complex formulas.
  • Using the wrong cell reference – if you type =A1+B1 but meant =A1+B2, the result will be wrong. Double-check your references.
  • Dividing by zero – if a cell in the denominator is empty or zero, you get a #DIV/0! error. Make sure all referenced cells have values.
  • Text in number cells – if a referenced cell contains text, calculations may return a #VALUE! error. Ensure cells contain numbers.

Tips

  • Use relative vs. absolute references – when you copy a formula, Excel changes references like A1 to B1, C1, etc. To keep a reference fixed, add dollar signs: $A$1 stays the same when copied. This is essential for constants like tax rates.
  • Use the Insert Function button – click the “fx” icon next to the Formula Bar to search for functions and see a dialog that helps you fill in arguments.
  • Start with simple formulas – break complex calculations into smaller steps in separate cells. This makes errors easier to find.
  • Use the status bar for quick checks – select a range of numbers and look at the bottom-right of the Excel window; it shows the sum, average, and count without writing a formula.
  • Learn keyboard shortcuts – press F2 to edit the active cell, and Ctrl+Enter to fill multiple selected cells with the same formula.

Troubleshooting

If your formula doesn’t work, try these fixes:

  • You see the formula as text – you likely forgot the equals sign. Click the cell, type “=” at the beginning, and press Enter.
  • You get a #NAME? error – this usually means you misspelled a function name (e.g., SUMM instead of SUM). Check the spelling.
  • You get a #VALUE! error – Excel can’t handle a value, often because a cell contains text or a blank where a number is needed. Check the referenced cells.
  • You get a #REF! error – a referenced cell has been deleted. Click Undo (Ctrl+Z) or edit the formula to point to existing cells.
  • You get a #DIV/0! error – the divisor is zero or empty. Change the value in the denominator or add an IFERROR function to handle it gracefully.
  • Results don’t update – if Excel is set to manual calculation, press F9 to recalculate. You can change this in File > Options > Formulas.

Frequently Asked Questions

What is the difference between a formula and a function?

A formula is any equation you type in Excel, like =A1+A2. A function is a predefined formula, like =SUM(A1:A2). Functions are used within formulas to save time and reduce errors.

How do I add a column of numbers quickly?

Click the cell below the column, then press Alt + = (Windows) or Command + Shift + T (Mac) to insert a SUM formula automatically. Or type =SUM(A1:A10) manually.

Why does my formula show the result but not the formula?

By default, Excel displays the result. To see the formula, click the cell and look at the Formula Bar above the grid. To show all formulas on the sheet, press Ctrl + ` (the key above Tab).

Can I use text in a formula?

Yes, but you must put text in double quotes, like ="Total: "&A1. The ampersand (&) joins text and numbers. However, arithmetic with text will cause errors.

How do I fix a formula that shows #N/A?

#N/A usually appears when a lookup function (like VLOOKUP) can’t find a match. Check that the lookup value exists in the table, and ensure the table range is correct.

What does the green triangle in a cell mean?

That’s an Excel error indicator. It often means the formula is inconsistent with neighboring formulas or has a common mistake. Click the cell to see a warning icon and get suggestions.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.