What a formula does and when you need one

A formula in Excel is an instruction that tells a cell to calculate something instead of just holding a number or word. When you type a formula, Excel reads it, does the math or logic you asked for, and shows you the result. The simplest formulas add, subtract, multiply, or divide. More complex ones can count cells that match a condition, find the largest number in a range, or combine text from multiple cells.

You need a formula whenever you want a cell to update automatically when other cells change. If you manually type "15" into a cell because 10 plus 5 equals 15, that cell will always show 15 — even if you later change the 10 to 20. A formula that says "add these two cells" will show 25 the moment you change the 10, without you having to recalculate by hand.

The most common reason people reach for a formula is to total a column of numbers, average a set of values, or count how many cells contain a certain word. You also use formulas to compare values (like "is this number bigger than that one?") or to pull information from one part of a spreadsheet and display it somewhere else.

Key Takeaways

  • Every formula starts with an equals sign, followed by the instruction you want Excel to carry out.
  • Cell references like A1, B3, or C10 tell Excel which cells to use in the calculation, and they update automatically if those cells change.
  • The most useful starter formulas are SUM (to add), AVERAGE (to find the middle value), and COUNT (to count cells with numbers).
  • You can copy a formula down a column or across a row, and Excel will adjust the cell references for each new row or column automatically.
  • If a formula shows an error like #REF! or #VALUE!, it usually means you pointed it at the wrong cells or mixed numbers with text.

How to type a formula into a cell

Click on the cell where you want the result to appear. This is where the formula will live and where you will see the answer. Type an equals sign — this tells Excel that what follows is a formula, not just text or a number you are typing in.

After the equals sign, type the formula itself. For example, to add the numbers in cells A1 and B1, you would type =A1+B1. To multiply them, type =A1*B1. The symbols are: plus for addition, minus for subtraction, asterisk for multiplication, and forward slash for division.

Press Enter when you are done typing. Excel reads the formula, performs the calculation, and displays the result in that cell. The cell now contains the formula, even though you see only the result. If you click on the cell again, the formula bar at the top of the screen shows the actual formula you typed.

Using cell references instead of typing numbers

The power of a formula comes from using cell references — the addresses like A1, B2, or C10 — instead of typing the actual numbers. When you reference a cell, Excel watches that cell. If the number in it changes, the formula automatically recalculates.

Each cell has an address made of a letter (the column) and a number (the row). Column A is the first column on the left, column B is the second, and so on. Row 1 is the top row, row 2 is below it, and so on. The cell in the top-left corner is A1. The cell in the third column, fifth row is C5.

To write a formula that uses cell references, type the equals sign, then type the cell address instead of the number. For example, if you have a price in cell A1 and a quantity in cell B1, you can type =A1*B1 to multiply them. If the price changes tomorrow, you do not have to rewrite the formula — it recalculates on its own.

The most useful formulas to start with

SUM adds up all the numbers in a range of cells. A range is a group of cells in a row or column. To add cells A1 through A10, type =SUM(A1:A10). The colon between A1 and A10 means "from A1 to A10, including everything in between." This is much faster than typing =A1+A2+A3+A4 and so on.

AVERAGE finds the middle value. To find the average of cells B2 through B8, type =AVERAGE(B2:B8). Excel adds them all up and divides by how many cells there are. This is useful for finding an average score, average price, or average time.

COUNT counts how many cells in a range contain a number. Type =COUNT(C1:C20) to count the cells with numbers in that range. This is different from straightforward counting cells — it ignores empty cells and cells with text. A related formula, COUNTA, counts any cell that is not empty, whether it holds a number or text.

IF lets you make a decision. The formula checks whether something is true, and if it is, it shows one result; if it is not, it shows another. For example, =IF(A1>100,"Over budget","OK") checks whether the number in A1 is greater than 100. If it is, the cell displays "Over budget". If it is not, the cell displays "OK".

Copying a formula to other cells

Once you have written a formula in one cell, you can copy it to other cells without retyping it. Click on the cell with the formula. Look for the small square in the bottom-right corner of the cell — this is called the fill handle. Click and drag it down to copy the formula to the cells below, or drag it to the right to copy it across.

When you copy a formula, Excel is smart about adjusting the cell references. If your first formula is =A1+B1 in row 1, and you copy it down to row 2, the formula automatically becomes =A2+B2. Each row gets its own version of the formula, with the row numbers adjusted. This saves you from having to rewrite the formula for every row.

You can also copy a formula by clicking on the cell, pressing Ctrl+C (or Cmd+C on a Mac), then clicking on the cells where you want to paste it and pressing Ctrl+V (or Cmd+V). This method works the same way — the cell references adjust automatically for each new location.

Reading error messages when a formula goes wrong

If a formula does not work, Excel displays an error code instead of a number. The most common ones are #REF!, which means you pointed the formula at a cell that no longer exists or is not where you thought it was; #VALUE!, which means you tried to do math with text instead of numbers; and #DIV/0!, which means you tried to divide by zero (or by an empty cell).

To fix a #REF! error, click on the cell with the formula and look at the formula bar. Check whether the cell addresses are correct. If you deleted a column or row, the formula may be pointing at the wrong place. Rewrite the formula to point at the correct cells.

To fix a #VALUE! error, check whether you are trying to add or multiply text. For example, if a cell contains the word "apple" instead of a number, a formula that tries to add it will fail. Make sure all the cells you are doing math with actually contain numbers, not words.

To fix a #DIV/0! error, check whether you are dividing by a cell that is empty or contains zero. Rewrite the formula to divide by a different cell, or fill in the empty cell with a number.

Frequently Asked Questions

Can I use a formula that refers to cells in a different sheet?

Yes. Type the sheet name, then an exclamation point, then the cell address. For example, =Sheet2!A1+B1 adds the value in cell A1 of Sheet2 to the value in cell B1 of the current sheet. If the sheet name has spaces in it, put the name in single quotes: ='Sales Data'!A1.

What is the difference between a relative reference and an absolute reference?

A relative reference (like A1) changes when you copy the formula to a new cell. An absolute reference (like $A$1) stays the same. Use absolute references when you want a formula to always point at the same cell, no matter where you copy it. Type the dollar sign before the column letter and row number: =A1*$B$1 will always multiply by B1, even if you copy it down.

Can I write a formula that uses text, not just numbers?

Yes. You can join text from multiple cells using the ampersand symbol (&). For example, =A1&" "&B1 combines the text in A1, a space, and the text in B1. You can also use the CONCATENATE function: =CONCATENATE(A1," ",B1) does the same thing.

How do I make a formula show a result with a specific number of decimal places?

Use the ROUND function. =ROUND(A1/B1,2) divides A1 by B1 and rounds the result to 2 decimal places. Change the 2 to any number of decimal places you want. This is useful for prices or percentages where you do not want to see many decimal places.

What does it mean when a formula shows a number with a # symbol, like #####?

The column is too narrow to display the result. Double-click on the line between the column letters at the top to auto-fit the column width, or drag the line to the right to make the column wider. The formula is working correctly — Excel just needs more space to show the number.