To lock a cell reference in Excel, highlight the cell address in your formula bar and press the F4 key. This adds dollar signs ($) to the reference, turning it into an absolute reference so that the cell stays fixed when you drag or copy the formula to other cells.
By default, Excel uses "relative references." This means if you have a formula in cell B1 that refers to A1, and you drag it down to B2, the formula automatically changes to refer to A2. Locking the reference (making it "absolute") prevents this shift, which is essential when you are referencing a single constant value, such as a tax rate, a discount percentage, or a specific date, located in one specific cell.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A keyboard with a function key row (F1-F12).
Step-by-Step
- Select the cell where you want to enter or edit your formula.
- Start your formula by typing the equals sign (=) and selecting the cell you wish to reference (e.g.,
=A1*B1). - Place your cursor on the specific cell reference you want to lock. You can do this by clicking on the reference inside the formula bar at the top of the screen or by using the arrow keys while still editing the cell.
- Press the F4 key. Excel will automatically insert dollar signs into the reference. For example,
A1will become$A$1. - Press Enter to complete the formula.
- Test the lock by clicking the fill handle (the small green square in the bottom-right corner of the cell) and dragging the formula down or across. The locked reference (the one with the $ signs) will remain the same in every cell, while the unlocked references will change relatively.
Common Mistakes
Pressing F4 at the wrong time: If your cursor is not blinking specifically on or next to the cell reference (e.g., if it is at the end of the formula after a parenthesis), pressing F4 may not do anything or may lock the wrong part of the equation. Always ensure the cursor is touching the cell address you intend to fix.
Over-locking: Some users lock every single cell in a formula. If you lock everything, you cannot drag the formula to perform repetitive calculations on different rows. Only lock the cells that contain the "constant" value that should never change.
Forgetting the Fn key: On many modern laptops, the F4 key is shared with a media or system function (like brightness or volume). If pressing F4 doesn't work, you likely need to hold the Fn key while pressing F4.
Tips
Cycle through reference types: You don't have to type dollar signs manually. If you keep pressing F4 while your cursor is on the reference, Excel cycles through the four different types of references in this order:
- Absolute:
$A$1(Both column and row are locked). - Mixed (Row locked):
A$1(The column changes, but the row stays at 1). - Mixed (Column locked):
$A1(The row changes, but the column stays at A). - Relative:
A1(Everything changes when copied).
Locking multiple references: If your formula uses the same cell reference in multiple places (e.g., =(A1*B1)/A1), you must place your cursor on each instance of that reference and press F4 for each one individually.
Troubleshooting
The F4 key isn't doing anything: First, check if your keyboard has an "Fn Lock" key. If not, try holding the Fn key (usually found in the bottom left of the keyboard) and then pressing F4. This is the most common reason the shortcut fails on laptops.
The dollar signs are appearing, but the formula still changes: Double-check that you pressed Enter to save the formula before dragging. Also, ensure you are dragging the cell using the fill handle and not manually typing the formula into new cells.
I'm on a Mac and F4 doesn't work: On macOS, the shortcut is often Command + T. If you prefer using the function keys, you may need to go to System Settings > Keyboard and enable "Use F1, F2, etc. keys as standard function keys."
Frequently Asked Questions
What is the difference between A1 and $A$1?
A1 is a relative reference; it changes based on where you move the formula. $A$1 is an absolute reference; it stays pointed at cell A1 regardless of where the formula is copied.
Can I lock just the row or just the column?
Yes. By pressing F4 multiple times, you can create a mixed reference. For example, A$1 locks the row, meaning the formula can move across columns but will always stay on row 1.
Do I have to use the shortcut, or can I type it?
You can manually type the dollar sign ($) before the column letter and the row number to achieve the same result as the F4 shortcut.
Does this work in Google Sheets?
Yes, the F4 shortcut works similarly in Google Sheets to toggle between relative and absolute references.
Why would I want a mixed reference (like $A1)?
Mixed references are useful for creating tables (like multiplication tables) where you want the formula to always look at a specific column for one value but a specific row for another as you drag the formula across a grid.