Find a course

Module 2: Formulas and FunctionsLesson 5 of 1212 min

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.

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.

Copying =B2*C2 down column D: the references move with the row, becoming =B3*C3 and =B4*C4BCD1234QtyPriceTotal34.00=B2*C252.50=B3*C326.00=B4*C4drag the fill handle down:each row points at itsown quantity and priceA relative reference means "the cell this far away," not "this exact cell"

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:

ReferenceCopied downCopied rightName
F1Row changesColumn changesRelative
$F$1Stays F1Stays F1Absolute
F$1Row stays 1Column changesMixed (row locked)
$F1Row changesColumn stays FMixed (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.

Relative versus absolute: copying =D2*F1 down shifts F1 to F2 and F3, which are empty, giving zero; =D2*$F$1 keeps every row pointing at the rate in F1Relative F1: breaksDEF1235%=D2*F1=D3*F2=D4*F3F2 and F3 are empty → $0Absolute $F$1: worksDEF1235%=D2*$F$1=D3*$F$1=D4*$F$1every row multiplies by F1The $ locks the column letter and the row number

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.