Why a reference needs locking
When you copy a formula, Excel shifts its relative references. That helps when each row should use its own numbers. It backfires when every row should use the same value, such as a tax rate kept in one cell.
Here is a simple case. The tax rate is in F1. In C2, the formula =B2*F1 works. Copy it down to C3, and it becomes =B3*F2. F2 is blank, so C3 shows 0. Locking the rate as $F$1 keeps every copy aimed at the same cell.
The same pattern shows up in any sales tax formula in excel that applies one rate to every line.
Type the dollar signs
Put a dollar sign in front of the column letter, the row number, or both:
$F$1locks both. The reference always means F1.$F1locks the column. The row can still change when copied down.F$1locks the row. The column can still change when copied across.
You can type these yourself, or select the reference while editing and press F4 to cycle through all four forms. For the full press order, see what does f4 do in excel formula.
A grid example
A two-way grid is a good test of mixed references. Put the numbers 1 to 5 down A2:A6 and across B1:F1. In B2, enter:
=$A2*B$1
Fill it right to F2, then fill down to F6. Each cell multiplies the number in its row, taken from column A, by the number in its column, taken from row 1. The column part of $A2 stays on column A, and the row part of B$1 stays on row 1. The result is a complete multiplication table.
Lock lookup tables
A lookup function needs a fixed table to search. In this formula:
=VLOOKUP(A2,$D$2:$E$20,2,FALSE)
the table range $D$2:$E$20 is locked. Copy the formula down, and every row searches the same table. Without the dollar signs, the range slides down with each row, so the first rows drop out of the table and the results go wrong or go missing. If the function itself is new to you, how to use vlookup step by step explains each argument.
Names stay fixed on their own
Names are absolute by default. If you name F1 Tax_Rate, every formula that uses the name points to that cell no matter where it is copied. Creating names is covered in how to create named range in excel.
What dollar signs do not do
Dollar signs control copying and filling. They don’t control insertion. When you insert or delete rows and columns, Excel adjusts every reference, locked or not, so a locked reference still points to the same cell it pointed to before.
Common mistakes
- Locking everything. If every reference is absolute, every copy is identical. That is wrong when each row needs its own value.
- Locking the wrong part.
$F1copied down still changes its row number. Check that the part that should change does change. - Trusting the first cell. After you fill a formula, click a few of the copies and read their references.