Excel Relative and Absolute References
When you copy a formula, Excel changes its cell references. Knowing how and when this happens is one of the most important Excel skills.
Relative References
A normal reference like A2 is relative. When you copy the formula, the reference moves by the same number of rows and columns.
If C2 contains:
Example
=A2*B2and you fill it down, Excel adjusts it automatically:
| Cell | Formula after copying |
|---|---|
| C2 | =A2*B2 |
| C3 | =A3*B3 |
| C4 | =A4*B4 |
That is usually exactly what you want: each row uses its own values.
The Problem: One Fixed Cell
Ali wants to add 18% sales tax to every price. He puts the tax rate in one cell, E1, so he can change it later.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Item | Price | Tax | 18% | |
| 2 | Fan | 6500 | |||
| 3 | Iron | 3200 | |||
| 4 | Kettle | 2800 |
In C2 he writes =B2*E1 and fills it down. But C3 becomes =B3*E2 and C4 becomes =B4*E3. E2 and E3 are empty, so the tax shows as 0. The reference to the rate moved, but it should have stayed on E1.
Absolute References
Add a dollar sign $ before the column letter and the row number to lock the reference:
Example
=B2*$E$1Now fill it down:
| Cell | Formula | Result |
|---|---|---|
| C2 | =B2*$E$1 | 1170 |
| C3 | =B3*$E$1 | 576 |
| C4 | =B4*$E$1 | 504 |
B2 moves to B3 and B4, but $E$1 always stays the same. If the tax rate changes to 17%, Ali changes only E1 and every row updates.
Press F4 while the cursor is on a reference in the formula bar to add the dollar signs. Press it again to cycle through $E$1, E$1, $E1 and E1.
Mixed References
Sometimes you want to lock only the row or only the column:
| Reference | Column | Row |
|---|---|---|
A1 | Moves | Moves |
$A$1 | Locked | Locked |
A$1 | Moves | Locked |
$A1 | Locked | Moves |
Example: a multiplication table
Put the numbers 1 to 5 in B1:F1 and in A2:A6. In B2 write:
Example
=$A2*B$1Fill it right to F2, then down to row 6. Column A stays locked for the left numbers, row 1 stays locked for the top numbers:
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 | |
| 2 | 1 | 1 | 2 | 3 | 4 | 5 |
| 3 | 2 | 2 | 4 | 6 | 8 | 10 |
| 4 | 3 | 3 | 6 | 9 | 12 | 15 |
| 5 | 4 | 4 | 8 | 12 | 16 | 20 |
| 6 | 5 | 5 | 10 | 15 | 20 | 25 |
One formula builds the whole table.
References to Other Sheets
You can use a cell from another sheet by writing the sheet name and ! before the address:
Example
=Prices!B2*Sales!C2If the sheet name has spaces, wrap it in single quotes:
Example
='October Sales'!D10The easiest way is to type =, click the other sheet's tab, click the cell and press Enter. Excel writes the reference for you.
Named Cells
Instead of $E$1, you can give the cell a name. Select E1, click the Name Box, type TaxRate and press Enter. Then:
Example
=B2*TaxRateNamed cells are always absolute, and formulas become easier to read.
Exercise
Exercise
You want a formula to always use cell H1 when it is copied anywhere. How should you write the reference?
