Skip to content

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:

RowABC
1ReferenceFilled downFilled across
2B2the row movesthe column moves
3$B$2stays on B2stays on B2
4$B2the row movesstays in column B
5B$2stays in row 2the 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$3
Multiplies the guests in column B of its own row by the price in row 3 of its own column.

Filled to F8, it returns $800.00 in C4, 25 guests at $32.00, and $7,800.00 in F8, 150 guests at $52.00.

Every cell reads the guest count in column B of its own row and the price in row 3 of its own column. Down column E, only the row of $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)
Adds the sales from C4 down to the formula's own row. Filled down, the start stays on C4 and the end moves.
The locked start stays on C4 and the end follows the formula down, so the range grows by one week on each row. In D6, =SUM($C$4:C6) returns $3,580. Formula in D: D4 =SUM($C$4:C4), D5 =SUM($C$4:C5), D6 =SUM($C$4:C6), D7 =SUM($C$4:C7), D8 =SUM($C$4:C8).

Common mistakes

  • =B4*C3 filled across and down moves both references, so D5 becomes =C5*D4 and multiplies two other results.
  • =$B$4*C$3 locks the guests to row 4, so every row of the table quotes 25 guests.
  • =B$4*$C3 puts the dollar signs on the wrong parts and fills the table with the wrong pairs.
  • =SUM(C4:C4) filled down moves the start of the range too, so each row adds only its own week.

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:C4 keeps the start of a range in place while its end moves.

Practice

Premium

5 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.