Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Lock a Sum in Excel: Absolute References

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To lock a sum in Excel, turn the cell references in the formula into absolute references by placing a dollar sign before the column letter and the row number, for example =SUM($A$1:$A$10). You can type the dollar signs yourself or select the range in the formula bar and press F4 (Fn+F4 on many laptops) to cycle through relative, absolute, and mixed references. That is the whole trick: the SUM function itself does not need locking, only the range it points at.

Locking matters when you copy or fill a formula across rows or columns. Without dollar signs, Excel shifts the range relative to where the formula lands, so your total can quietly start summing the wrong cells. The steps below work in Excel for Microsoft 365, Excel 2021 and 2019, and Excel for Mac; labels can differ slightly by version, device and region.

What You'll Need

  • Excel on Windows, Mac, or the web (the web version supports absolute references but the F4 shortcut behaves differently in some browsers, so typing the dollar signs is safer there).
  • A worksheet with data and a cell where you want the sum to appear.
  • Basic familiarity with the formula bar, which sits above the grid and shows the active cell's contents.

Step-by-Step

  1. Click the cell where the total should go. For example, click B12 if your numbers are in column B.
  2. Type =SUM( to start the formula. Do not press Enter yet.
  3. Select the range you want to add, such as A2 through A10. Excel inserts the range into the formula automatically.
  4. Close the parenthesis with ). The formula bar should read something like =SUM(A2:A10).
  5. Now lock the range. Click inside the range text in the formula bar so the cursor sits on A2:A10, then press F4. On a laptop where the function keys are media keys, hold Fn and press F4. On a Mac, F4 may need Fn as well, or you can use the shortcut Cmd+T in some layouts; if neither works, type the dollar signs manually.
  6. Check that the range now reads $A$2:$A$10. Each reference has a dollar sign before both the column and the row.
  7. Press Enter to commit the formula. The cell shows the sum.
  8. Copy the formula to other cells with Ctrl+C and Ctrl+V (Cmd+C and Cmd+V on Mac), or drag the fill handle. Because the range is absolute, every copy sums the same A2:A10 block.
  9. If you only want to lock part of the reference, press F4 again while the range is selected. Excel cycles through $A$2:$A$10, A$2:A$10, $A2:$A10, and back to relative. Use a mixed reference when you want the column to stay fixed but the row to move, or the reverse.
  10. Verify by clicking a copied cell and reading the formula bar. It should still show $A$2:$A$10. If it shows A3:A11, the lock did not apply.

Common Mistakes

  • Locking the result cell instead of the range. Protecting the sheet or locking the cell that holds the total does not stop the formula from shifting. The dollar signs must be inside the SUM arguments.
  • Pressing F4 outside the formula bar. The shortcut only cycles references while you are editing the formula. If you press it with the cell selected but not in edit mode, nothing happens or Excel repeats the last action.
  • Forgetting the closing parenthesis. Excel will offer a correction, but accepting it blindly can produce a different range than intended.
  • Using absolute references everywhere. If you later insert rows inside the locked range, Excel usually adjusts the range, but inserting rows above it will not extend the sum. Decide whether you want a fixed block or a growing range before locking.
  • Confusing sheet protection with reference locking. Protecting a worksheet prevents edits; it does not stop a formula from pointing at the wrong cells.

Tips

  • Name the range instead of locking it. Select A2:A10, type a name such as SalesData in the Name Box to the left of the formula bar, and use =SUM(SalesData). Named ranges are absolute by default and easier to read.
  • Use a table. Convert the data with Ctrl+T (Cmd+T on Mac), then write =SUM(Table1[Amount]). Structured references expand automatically as rows are added and do not need dollar signs.
  • Press F4 repeatedly to cycle reference types quickly rather than retyping dollar signs.
  • Double-click a copied cell to see all precedents highlighted in colour, which makes it obvious whether the lock worked.
  • If you are locking a single cell reference rather than a range, the same F4 cycle applies: A1, $A$1, A$1, $A1.

Troubleshooting

  • The total changes when I copy it. The range is still relative. Re-open the formula, select the range, and press F4 until dollar signs appear.
  • F4 does nothing. You are probably not in edit mode, or your keyboard has function keys mapped to media controls. Press Fn+F4, or type the dollar signs manually.
  • The formula shows #REF! after copying. The locked range referred to cells that were deleted or moved. Undo with Ctrl+Z and check the source range still exists.
  • Excel converts my formula to a different range. This happens when you copy a formula that uses relative references into a row or column that shifts the range outside the sheet. Lock the range or switch to a named range.
  • The sum ignores new rows. A locked range like $A$2:$A$10 will not include row 11 if you add data below. Either extend the range, use a whole-column reference such as =SUM(A:A) (which ignores text and blanks), or convert the data to a table.

Frequently Asked Questions

What does locking a sum actually do?

It fixes the cell range the SUM formula points at so that copying or filling the formula elsewhere keeps adding the same cells.

Do I need to lock the SUM function itself?

No. The function name never changes. Only the cell references inside the parentheses need dollar signs.

Can I lock a sum without dollar signs?

Yes, by using a named range or an Excel table with a structured reference. Both behave like absolute references.

Why does my locked sum still change when I insert a row?

Excel adjusts ranges when rows are inserted inside them, but inserting above a locked range does not extend it. Use a table or a whole-column reference if the data grows.

Does locking a sum protect it from being edited?

No. To prevent edits, protect the worksheet via Review > Protect Sheet, and make sure the cells are unlocked or locked as intended before you turn protection on.

Is the F4 shortcut the same on Mac?

It often requires Fn+F4, and some Mac keyboard layouts map function keys differently. Typing the dollar signs manually always works.