Sub topic 2
Relative references: formulas that move with you
This chapter assumes you can enter and edit a basic formula, select cells and ranges, and copy cells or use the fill handle. It covers how relative references behave, which is the default in every formula you write. It builds on A1 notation, the system where a column letter followed by a row number names a cell, such as C2.
What a relative reference really stores
When you type =A2*B2 in cell C2, Excel does not remember "column A, row 2" as a fixed place. In effect, it stores directions measured from the cell holding the formula. For =A2*B2 in C2, the directions are:
A2is two columns to the left, in the same row.B2is one column to the left, in the same row.
A reference that works this way is a relative reference. When the formula moves to a new cell by copying or filling, Excel replays the same directions from the new position. The pattern stays the same and the addresses change.
C2: =A2*B2
C3: =A3*B3Filling C2 down one row gives the second formula. Both references shifted down by one row, because C3 sits one row below C2.
A worked example
Suppose you track an order list with quantity in column A and unit price in column B. You want the line total in column C.
| Row | A | B | C |
|---|---|---|---|
| 1 | Quantity | Unit price | Line total |
| 2 | 3 | 4.50 | |
| 3 | 10 | 2.00 | |
| 4 | 6 | 1.25 |
- Select C2 and type
=A2*B2. The result is 13.5. - Select C2 again and drag the fill handle (the small square at the bottom-right corner of the selection) down to C4.
- Click C4. The formula bar shows
=A4*B4.
You wrote one formula and got three correct ones. Relative references exist for this purpose: one pattern repeated over many rows or columns.
Direction matters
Fill direction decides which part of the address changes.
- Filling down changes row numbers and leaves column letters alone.
- Filling right changes column letters and leaves row numbers alone.
- Filling diagonally, or copying to a cell that is both lower and further right, changes both.
Here is a row of monthly totals that you fill to the right:
B6: =SUM(B2:B5)
C6: =SUM(C2:C5)Each whole range shifts together. Excel moves both ends of B2:B5 by one column, so the result is C2:C5.
Copying to a distant cell
Relative references work from offsets, so the destination does not have to be adjacent. If you copy =A2*B2 from C2 and paste it into F10, the offsets are the same, so the pasted formula becomes =D10*E10. F10 is three columns right and eight rows down from C2, and each reference moves by the same amount.
This is useful, and it is also a common source of surprise. If the formula needed A2 specifically, the pasted version now points somewhere else, and Excel does not warn you.
Where relative references break down
Relative behavior is wrong whenever one part of a formula must stay put. Take a price list in column B with a tax rate in E1, and write this in C2:
C2: =B2*E1
C3: =B3*E2The B2 reference shifted correctly, but E1 shifted to E2, which is empty. Excel treats an empty cell as zero, so C3 shows 0 and no error appears. This is the typical symptom of a relative reference that should have been locked.
The next chapter fixes this with absolute references, which use $ to lock a cell in place. For now, the key point is that every reference you type without a $ is relative.
Checking what a filled formula does
You can verify relative behavior without guessing:
- Select a filled cell and read the formula bar.
- Press
Ctrl+ ``` (the grave accent key, usually above Tab) to switch the sheet to formula view, which shows every formula as text. Press it again to return. - Compare two neighboring formulas. The same offsets should appear in each.
In formula view, you can also double-click a formula to see colored outlines around the cells it references. The outlines show which cells the formula currently reads.
Quick reference
| Action | What happens to a relative reference |
|---|---|
| Fill down | Row number increases by 1 per cell |
| Fill right | Column letter moves one to the right per cell |
| Fill up or left | Row number decreases or column letter moves left |
| Copy and paste elsewhere | Offsets are preserved from the new location |
Exercise
Cell D3 contains =B3+C3. You copy D3 and paste it into F7. What formula does F7 contain, and why?
Show answer
F7 contains =D7+E7. F7 is two columns right and four rows down from D3, so each reference shifts by two columns and four rows. B3 becomes D7 and C3 becomes E7.
Exercise
You enter =B2*E1 in C2 and fill it down to C5. What formula appears in C5, and what is the likely visible problem?
Show answer
C5 contains =B5*E4. The reference to E1 drifted down to E4, which is probably empty, so the result is 0 for most rows. The tax rate cell needed to be locked, which the next chapter covers.