Lock a cell with $ when you copy a formula
Understand why a copied formula sometimes points at the wrong cell, and how a dollar sign keeps a total or a rate fixed.
BasicsBeginner8 minExcel · Google Sheets
Example content. The numbers are fictional and made for learning.
Goal
Work out each product's share of the total, with one formula copied down the column.
Why this is useful
Copying formulas is what makes spreadsheets fast. It only works when you know which cell names should move with the copy and which should stay put.
Example
| Row | A | B |
|---|---|---|
| 1 | Product | Sales |
| 2 | Mugs | 12 |
| 3 | Tote bags | 15 |
| 4 | Prints | 22 |
| 5 | Share for Mugs | 24.5%=B2/SUM($B$2:$B$4) |
Steps
1. See what copying does
A formula like =B2/B5 copied one row down becomes =B3/B6. Both cell names moved. That is a relative reference.
2. Lock what must stay
Put $ in front of the column letter and the row number: $B$5. Copied anywhere, it still points at B5. That is an absolute reference.
3. Use the shortcut
Click a cell name in the formula and press F4 in Excel (Fn+F4 or Cmd+T on some Macs) to cycle through B5, $B$5, B$5, and $B5.
4. Lock a whole range
For a share of the total, lock the range inside SUM: =B2/SUM($B$2:$B$4). Copy it down; the top changes, the total does not.
5. Lock only a row or a column
B$1 keeps the row and lets the column move. That is useful for tables where a rate sits in the header row.
Formulas by language
Cell names such as B2 stay the same. The function name and the character between arguments follow the spreadsheet language. The English line in each list is the reference form used on this site, not a universal spelling. When the decimal sign is a comma, arguments are usually separated with a semicolon, because the comma is already used in numbers.
Share of the total. Copy it down: only B2 changes.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=B2/SUM($B$2:$B$4)Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=B2/SUMMA($B$2:$B$4)German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=B2/SUMME($B$2:$B$4)French (France)
Decimals look like 1,5. Arguments are separated with ;.
=B2/SOMME($B$2:$B$4)Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=B2/SUMA($B$2:$B$4)Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=B2/SUMA($B$2:$B$4)Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=B2/SOMA($B$2:$B$4)Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=B2/SOMMA($B$2:$B$4)Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=B2/SOM($B$2:$B$4)
A price with the rate in E1, the same rate on every row.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=B2*(1+$E$1)Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=B2*(1+$E$1)German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=B2*(1+$E$1)French (France)
Decimals look like 1,5. Arguments are separated with ;.
=B2*(1+$E$1)Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=B2*(1+$E$1)Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=B2*(1+$E$1)Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=B2*(1+$E$1)Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=B2*(1+$E$1)Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=B2*(1+$E$1)
Mixed: the column B and row 1 stay, the rest moves. Used in two-way tables.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=$B2*C$1Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=$B2*C$1German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=$B2*C$1French (France)
Decimals look like 1,5. Arguments are separated with ;.
=$B2*C$1Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=$B2*C$1Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=$B2*C$1Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=$B2*C$1Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=$B2*C$1Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=$B2*C$1
The same spoken language can use different separators in different countries. Spanish in Spain often uses a comma for decimals and a semicolon between arguments. Spanish in Mexico often uses a period and a comma. If a formula is rejected, check the spreadsheet locale.
Excel and Google Sheets
- Dollar signs work the same in every language and in both Excel and Google Sheets.
- In Google Sheets the shortcut is F4 as well; on a Mac it is Fn+F4 or Cmd+T in some versions.
- Workbooks from Hellosheetwise already use $ where a rate or total must stay fixed.
If something goes wrong
Copied rows show #DIV/0! or 0.
The total moved down with the copy and now points at an empty cell. Add $ signs to the total.
Every row shows the same result.
The changing cell is locked too. Remove the $ from the cell that should move, such as B2.
Inserting a row breaks the total.
Insert rows inside the locked range, not below it, so $B$2:$B$4 grows to include them.