An Excel formula is a calculation entered into a cell using the equals sign (=) to perform mathematical operations like addition, subtraction, multiplication, or division on numbers and text. Before writing one, ensure your data is organized in columns and rows so the formula can reference specific cells accurately.

What You'll Need

  • A computer with Microsoft Excel installed (desktop or web version).
  • A set of data to work with, such as a list of prices and quantities.

Step-by-Step

  1. Open Excel and navigate to the spreadsheet where you want to perform the calculation.
  2. Select the target cell where you want the result of the formula to appear. This is the empty cell at the end of your data set if you are calculating a total.
  3. Start the formula by typing the equals sign (=) into the selected cell. The cell reference will change color to indicate it is active.
  4. Enter the first cell reference. Click on the cell containing the first number you want to calculate (e.g., type A1 or click cell A1).
  5. Add an operator. Type the mathematical symbol for the operation you want to perform (e.g., + for addition, - for subtraction, * for multiplication, or / for division).
  6. Enter the next cell reference. Click on the cell containing the second number you want to include in the calculation.
  7. Repeat or finish. Continue adding more operators and cell references as needed (e.g., + C1). When you are finished, press the Enter key on your keyboard.
  8. Verify the result. Excel will calculate the sum and display the final number in the cell. Clicking on the cell will show the formula in the formula bar above the grid.

Common Mistakes

One of the most frequent errors when writing formulas is typing a space between the operator and the cell reference, such as = A1 + B1. Spaces are interpreted as text and will cause the formula to return a #VALUE! error. Always ensure there are no spaces between the equals sign and the first number, or between the operator and the cell reference.

Another common mistake is referencing the wrong cell. If you drag your formula down to calculate totals for a list of items, ensure that the cell references are relative (e.g., =A2+B2) rather than absolute (e.g., =$A$1+$B$1). Relative references allow Excel to adjust the row number automatically as you drag the formula, whereas absolute references keep the same row, leading to incorrect totals.

Tips

Use the AutoFill handle (the small square at the bottom-right corner of the selected cell) to quickly apply the same formula to a range of adjacent cells. After typing your formula in the first cell, hover your mouse over the handle, click, and drag down to the last row you want to calculate.

To ensure your data is treated as numbers and not text, check the cell format. If a cell contains a number that is left-aligned but looks like text, it may not calculate correctly. You can convert it by typing a 1 into a blank cell, copying it, selecting your data range, right-clicking, and choosing Paste Special > Multiply.

Troubleshooting

If the cell displays a long string of text starting with # (like #NAME? or #VALUE!), check your spelling. Excel formulas are case-insensitive for function names, so SUM, sum, and Sum are all valid. However, if you typed a name that does not exist, the error will occur.

If the result is #REF!, it means your formula is referencing a cell that no longer exists. This often happens if you delete a row or column that was part of your formula's range. To fix this, click on the error cell, press Ctrl + Z to undo the deletion, or manually edit the formula to remove the invalid reference.

If the cell displays a long string of # characters (like #DIV/0!), it means you are trying to divide a number by zero. This happens if you are summing values in a column but the column is empty, or if you are dividing by a cell that contains a zero. You can handle this by wrapping your calculation in an IF function to return a specific value or leave the cell blank if the denominator is zero.

Frequently Asked Questions

Can I use mathematical operators with text?

Yes, you can concatenate text strings using the ampersand symbol (&). For example, typing =A1 & " " & B1 will combine the contents of cell A1 and cell B1 with a space in between.

How do I subtract dates in Excel?

You subtract one date from another to find the difference in days. For example, typing =B1-A1 where A1 is an earlier date and B1 is a later date will return the number of days between them.

Why does my formula show the text instead of the number?

If a formula returns a number but displays it as text, it is likely because the cell is formatted as Text. You can fix this by right-clicking the cell, selecting Format Cells, choosing Number, and then clicking OK.

What is the difference between SUM and AVERAGE?

The SUM function adds all the numbers in a range, while the AVERAGE function calculates the mean by dividing the sum of the numbers by the count of those numbers.

How do I fix a circular reference error?

A circular reference occurs when a formula refers to its own cell, either directly or through a chain of other formulas. Excel will usually alert you to this. To fix it, examine your formulas to ensure the calculation is not dependent on the result of the cell itself.