Excel F4 Key: How to Use Absolute and Relative References
In this article
The F4 key in Microsoft Excel is used to toggle between relative, absolute, and mixed cell references within a formula. By pressing F4 while your cursor is on a cell reference in the formula bar, you can quickly add or remove dollar signs ($) to lock specific rows or columns, ensuring that when you copy or drag a formula to other cells, the reference stays fixed on a specific cell or range rather than shifting based on the new position.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A keyboard with a function row (F1-F12).
- A dataset or a basic spreadsheet with values to reference.
Step-by-Step
- Enter Edit Mode: Click on the cell where you want to create your formula. Type the equals sign (=) to begin the formula.
- Select Your Reference: Type the cell address (e.g., A1) or click on the cell you wish to reference. For example, if you are calculating sales tax, you might click on cell B1, which contains the tax rate.
- Activate the F4 Shortcut: While the cursor is blinking directly on or immediately after the cell reference (e.g., B1), press the F4 key on your keyboard.
- Observe the Cycle: Each time you press F4, Excel cycles through four different reference types. Watch the cell reference in the formula bar to see the change:
- First Press: Changes the reference to Absolute (e.g., $B$1). Both the column and row are locked.
- Second Press: Changes the reference to Mixed - Row Absolute (e.g., B$1). The row is locked, but the column can change.
- Third Press: Changes the reference to Mixed - Column Absolute (e.g., $B1). The column is locked, but the row can change.
- Fourth Press: Returns the reference to Relative (e.g., B1). Nothing is locked.
- Complete the Formula: Finish the rest of your mathematical operation (e.g., =A2*$B$1) and press Enter.
- Test the Reference: Click the fill handle (the small square at the bottom-right of the cell) and drag the formula down or across. You will notice that the relative parts of the formula update to the new rows/columns, while the parts locked with the F4 key remain exactly the same.
Common Mistakes
One of the most frequent errors users make is pressing F4 while the cursor is not active on the cell reference. If your cursor is at the end of the formula or on an operator (like + or *), pressing F4 will not add dollar signs to your cell references. You must ensure the cursor is touching the specific coordinate you wish to lock.
Another common mistake is over-locking. New users often lock every single cell in a formula, turning everything into absolute references. This defeats the purpose of Excel's automation. If every reference is absolute, dragging the formula down will simply repeat the exact same result in every cell rather than calculating new values for each row.
Users also frequently forget that the F4 key has a secondary function in Excel: repeating the last action. If you are not currently editing a formula, pressing F4 will repeat your previous formatting or insertion action (such as highlighting a cell yellow or inserting a row). This can lead to confusion if you think you are editing a formula but are actually applying formatting to random cells.
Tips
To master the F4 key, it is helpful to understand the logic of the dollar sign. Think of the $ as a "lock" or a "pin." If the $ is in front of the B ($B1), the column B is pinned. If the $ is in front of the 1 (B$1), the row 1 is pinned. If both are present ($B$1), the entire cell is pinned to the map regardless of where you move the formula.
For those working with large tables, use mixed references (the second and third presses of F4) to create multiplication tables or complex grids. For instance, if you lock only the row for your headers and only the column for your side-labels, you can write one single formula in the top-left cell and drag it across the entire grid to fill hundreds of cells instantly with correct calculations.
If you are using a laptop, you may find that pressing F4 does nothing or changes your volume/brightness. This is because your laptop is set to "Media Keys" by default. To use the Excel F4 function, you must hold the Fn key (usually found in the bottom left of the keyboard) while pressing F4.
Troubleshooting
If the F4 key is not adding dollar signs to your formula, first check if you are actually in "Edit Mode." You must either double-click the cell or click into the formula bar at the top of the screen. If you simply have the cell selected but aren't editing the text of the formula, F4 will perform the "Repeat Last Action" function instead of the reference toggle.
If you are pressing F4 and the laptop is performing a system function (like muting audio), look for a "Fn Lock" key on your keyboard (often shared with the Esc key or Caps Lock). Pressing Fn + Esc usually toggles the function keys so that F4 works as a standard function key without needing to hold the Fn modifier.
If you find that your formulas are still shifting even after you think you used F4, click on the cell and look closely at the formula bar. Ensure the dollar signs are exactly where you intended. A common slip is pressing F4 too many times and accidentally cycling back to a relative reference (B1) without realizing it.
Frequently Asked Questions
Does F4 work on Excel for Mac?
Yes, but depending on the keyboard settings, you may need to use Command + T or hold the Fn key while pressing F4 to achieve the same result.
Can I manually type the dollar signs instead of using F4?
Yes. Typing the $ symbol directly before the column letter or row number is functionally identical to using the F4 shortcut.
What is the difference between $A1 and A$1?
$A1 locks the column; if you drag the formula horizontally, it will always look at column A. A$1 locks the row; if you drag the formula vertically, it will always look at row 1.
Does F4 work in Google Sheets?
Yes, Google Sheets supports the F4 shortcut for toggling absolute and relative references in the exact same way as Microsoft Excel.
Can F4 be used for ranges of cells?
Yes. If you highlight a range like A1:B10 in your formula and press F4, Excel will apply the lock to both the start and end of the range (e.g., $A$1:$B$10).