Relative and Absolute References
See how references shift when you copy a formula, lock cells with dollar signs, use F4 and named ranges, and calculate shares of a total correctly.
Welcome back!
Step 1 of 10Learn
One formula, a hundred rows
In a sales sheet, column B holds quantities and column C holds prices. In D2, you write =B2*C2 to get the line total. Now you need the same calculation for 100 rows.
You don't write 100 formulas. Select D2 and drag the fill handle down to D101 (or double-click it). Sheets copies the formula, and something clever happens: in D3 it becomes =B3*C3, in D4 =B4*C4, and so on.
This works because ordinary references are relative. Sheets doesn't really store "B2"; it stores the idea "the cell two columns to my left, in my row." Copy the formula one row down and the meaning stays the same, so the address shifts by one row. Copy it one column to the right and B becomes C.
Relative references are what make copying formulas so powerful. They're also behind the most common spreadsheet error, which you'll see next: sometimes you need a reference to stay put.
Step 2 of 10Note
Step 3 of 10Practice · Choose one
Cell E5 contains =C5+D5. You copy E5 and paste it into E9. What formula does E9 contain?
Step 4 of 10Learn
Locking a reference with $
Now add a commission column. The commission rate, 5%, sits in one cell: F1. In E2 you write =D2*F1, which works. You drag it down, and row 3 shows =D3*F2, row 4 =D4*F3. Those cells are empty, so every commission after the first is $0.
The fix is an absolute reference. A dollar sign in front of the column letter or row number locks it:
| Reference | Copied down | Copied right | Name |
|---|---|---|---|
| F1 | Row changes | Column changes | Relative |
| $F$1 | Stays F1 | Stays F1 | Absolute |
| F$1 | Row stays 1 | Column changes | Mixed (row locked) |
| $F1 | Row changes | Column stays F | Mixed (column locked) |
Write =D2*$F$1 in E2 and drag down: row 3 becomes =D3*$F$1, row 4 =D4*$F$1. The sales cell moves; the rate stays locked.
You don't have to type the dollar signs. While editing a formula, put the cursor on a reference and press F4 (on many Macs, Fn+F4). Each press cycles through F1 → $F$1 → F$1 → $F1 → F1.
The rule of thumb: when a formula points to one fixed cell that every row should use, such as a rate, a target, a total or an exchange rate, make that reference absolute.
Step 5 of 10Try the calculator
Commission with a locked rate
Every row multiplies its own sales by the same rate cell, $F$1. Change the rate once and every row updates. Try to imagine the same sheet with a relative F1: only the first row would be right.
- E2
=D2*$F$1 - 210 $
- E3
=D3*$F$1 - 340 $
- E4
=D4*$F$1 - 155 $
- Total commission
- 705 $
Step 6 of 10Practice · Fill in the blanks
Fill in the blanks
A formula in B2 is =A2*D1, where D1 holds a tax rate. To keep the reference to D1 fixed when copying the formula down the column, rewrite it as =A2*.
Step 7 of 10Learn
Share of total and named ranges
A classic use of absolute references is calculating each item's share of a total. Suppose B2:B6 holds sales for five products and B7 holds the total, =SUM(B2:B6). In C2, the share is =B2/$B$7, formatted as a percent. Drag down: each row divides its own sales by the same locked total. Without the dollar signs, row 3 would divide by B8, an empty cell, and show a #DIV/0! error.
With sales of $500, $300, $150, $40 and $10 (total $1,000), the shares come out to 50%, 30%, 15%, 4% and 1%, which add up to 100%, a quick sanity check worth doing every time.
For values used all over a spreadsheet, a named range makes formulas easier to read. Select the cell with the rate, choose Data > Named ranges, and name it, for example, TaxRate. Formulas can then say =B2*TaxRate. Named ranges behave like absolute references, and anyone reading the formula understands it instantly.
Mixed references shine in grids. In a multiplication table with numbers 1–10 down column A and across row 1, the formula =$A2*B$1 in B2 can be copied across the whole grid: the column is locked to A for the row numbers and the row is locked to 1 for the column numbers.
Step 8 of 10Note
Step 9 of 10Practice · What would you do?
What would you do?
You copied =B2/B10 down from C2 to C9 to find each region's share of the total in B10. C2 shows 18%, but C3 to C9 all show #DIV/0!. What is the fix?
Step 10 of 10Practice · True or false
A mixed reference such as B$1 keeps the row fixed but lets the column letter change when the formula is copied sideways.
Lesson complete!