How to Lock a Cell in Excel with $ and F4

Learn how to lock a cell in Excel using $ and F4 so fixed rates, settings, and lookup cells stay unchanged when formulas are copied.

To lock a cell in an Excel formula, add a dollar sign before the column letter and row number. For example, $H$4 keeps the formula pointing to cell H4 when you copy it to other cells.

In Excel for Windows desktop, select the reference in the formula bar and press F4 to cycle through the available reference types. You can also type the dollar signs yourself, which works on every platform.

Lock one cell while copying a formula

Imagine that the promotion discount rate is 15% in cell H4. You want to calculate discounted prices for several products in column B.

In the first sale-price cell, enter:

=B5*(1-$H$4)

Then fill the formula down. Excel changes B5 to B6, B7, and so on because the price should come from each row. It keeps $H$4 unchanged because the discount rate is stored in one fixed cell.

Excel discounted-price table using a fixed 15 percent discount rate in cell H4.
The dollar signs keep the discount rate fixed while the product-price reference changes for each row.

Without the dollar signs, the copied formulas would point to H5, H6, and later cells instead of the rate in H4. That usually produces incorrect results or errors.

What does $H$4 mean?

The dollar sign locks the part of the reference that follows it:

  • $H$4 locks column H and row 4. Use this for one fixed cell.
  • H$4 locks row 4 but allows the column to change.
  • $H4 locks column H but allows the row to change.
  • H4 locks nothing. It is a normal relative reference.

For most readers searching for how to lock a cell, $H$4 is the answer: lock both the row and column of a rate, tax percentage, target, lookup value, or other fixed input.

Use F4 to add dollar signs quickly

In Excel for Windows desktop, you can switch a selected reference instead of typing dollar signs manually:

  1. Select the cell that contains the formula, then press F2 or click the formula bar.
  2. Select the reference you want to change, such as H4.
  3. Press F4 until the reference becomes $H$4.
  4. Press Enter, then copy or fill the formula as needed.
Excel reference cycle showing how F4 changes H4 to absolute and mixed cell references.
Press F4 repeatedly to move from a relative reference to absolute and mixed references.

In Excel for Mac, Microsoft documents Command + T for cycling a selected reference; F4 can also work depending on your keyboard settings. In Excel for the web, type the dollar signs manually.

Common mistakes when locking a cell

Locking the value that should change

In the discount example, B5 should remain relative. If you use =$B$5*(1-$H$4) and fill down, every row will use the first product’s price.

Locking only the row or only the column by accident

H$4 and $H4 are mixed references. They are useful when you copy across and down, but they do not fully lock one cell. For a single fixed rate in H4, use $H$4.

Pressing F4 when the cursor is not inside the reference

Excel changes only the selected reference. Click directly on H4 in the formula bar before pressing F4. If the shortcut does not work, type $H$4 manually.

When should you use a mixed reference instead?

Use a mixed reference only when you need one part of the address to move. For example, a formula copied across a header row may need H$4 so the row remains fixed while the column changes. A formula copied down beside labels in column H may need $H4 so the column remains fixed while the row changes.

For a fuller explanation of relative, absolute, and mixed references, read Excel Cell References: Relative, Absolute, and Mixed. If you have already copied a formula and the result looks wrong, use our Excel formula troubleshooting guide to check calculation settings, text formatting, and inconsistent references.

Source and further reading

Microsoft explains how to switch between relative, absolute, and mixed references, including the F4 cycle. For Mac-specific reference behavior, see Switch between relative and absolute references.