Fill a table with mixed references
Mixed references and other sheets9 minPremium
Builds on Copy a formula down a column and Add it up with SUM.
A catering company in Toronto quotes every event from one table: the number of guests down the side, the price per guest of each menu across the top. A single formula, filled across and down, fills the whole table when each reference is locked in the right place.
How it works
A reference has two parts, the column letter and the row number, and a $ locks each part on its own:
| Row | A | B | C |
|---|---|---|---|
| 1 | Reference | Filled down | Filled across |
| 2 | B2 | the row moves | the column moves |
| 3 | $B$2 | stays on B2 | stays on B2 |
| 4 | $B2 | the row moves | stays in column B |
| 5 | B$2 | stays in row 2 | the column moves |
A two-way table needs one of each. Filled across, every cell has to keep reading the guest count at the start of its own row, so that reference locks only its column, as in $B4. Filled down, every cell has to keep reading the price at the top of its own column, so that reference locks only its row, as in C$3.
A range can be half locked too. In $C$4:C4, the start stays on C4 while the end moves with the formula, so filled down, the range grows by one row at a time.
Press F4 while the cursor is in a reference to cycle it through $B$2, B$2, $B2 and back to B2. On a Mac, press CmdT.
Example
The guest counts are in B4:B8 and the price per guest of four menus in C3:F3. In C4:
=$B4*C$3Filled to F8, it returns $800.00 in C4, 25 guests at $32.00, and $7,800.00 in F8, 150 guests at $52.00.
$B4 changes. In E7, =$B7*E$3 returns $4,500. Formula in E: E4 =$B4*E$3, E5 =$B5*E$3, E6 =$B6*E$3, E7 =$B7*E$3, E8 =$B8*E$3.A running total works the same way. With weekly sales in C4:C8, this formula in D4, filled down, adds everything from the first week to its own row:
=SUM($C$4:C4)Common mistakes
=B4*filled across and down moves both references, so D5 becomesC3 =C5*and multiplies two other results.D4 =$B$4*locks the guests to row 4, so every row of the table quotes 25 guests.C$3 =B$4*puts the dollar signs on the wrong parts and fills the table with the wrong pairs.$C3 =SUM(filled down moves the start of the range too, so each row adds only its own week.C4:C4)
In short
- A
$before the letter locks the column, and a$before the number locks the row. - In a two-way table, lock the column of the inputs down the side and the row of the inputs across the top.
$C$4:C4keeps the start of a range in place while its end moves.
Practice
Premium5 exercises: 3 formulas, 1 quiz question and 1 shortcut.
Practice is part of Premium
Every lesson is free to read, and you can practice the free lessons without an account. This lesson's exercises are part of Premium, which you add to a free account.
Have one? Sign in