To put F4 in Excel, you press the F4 key on your keyboard while your cursor is touching a cell reference within a formula. This action toggles the reference between relative (A1), absolute ($A$1), and mixed ($A1 or A$1) formats, effectively "locking" the row or column so it does not change when you copy the formula to other cells.

What You'll Need

  • A computer with Microsoft Excel installed (Windows or macOS).
  • A keyboard with a function row (F1-F12).
  • An active worksheet with data to reference in a formula.

Step-by-Step

  1. Enter Formula Mode: Click on the cell where you want your calculation to appear. Type the equals sign (=) to start your formula.
  2. Select Your Reference: Type the cell address (e.g., B2) or click on the cell you wish to reference with your mouse.
  3. Position the Cursor: Ensure your blinking cursor is either touching the cell reference or highlighting it. For example, if your formula is =B2*C2 and you want to lock B2, place the cursor anywhere on the characters "B2".
  4. Press F4: Press the F4 key once. Excel will automatically insert dollar signs around the reference, changing B2 to $B$2. This is an absolute reference.
  5. Cycle Through Reference Types: If you do not want a fully locked cell, continue pressing F4 to cycle through the available options:
    • First Press: Absolute reference ($B$2) — both column and row are locked.
    • Second Press: Mixed reference (B$2) — only the row is locked; the column can change.
    • Third Press: Mixed reference ($B2) — only the column is locked; the row can change.
    • Fourth Press: Relative reference (B2) — nothing is locked; the reference returns to its original state.
  6. Complete the Formula: Finish the rest of your mathematical operation and press Enter.
  7. Test the Lock: Click the fill handle (the small green square at the bottom-right of the cell) and drag the formula down or across. You will notice that the cell with the dollar signs remains constant while the other references shift.

Common Mistakes

One of the most frequent errors is pressing F4 at the wrong time. If you press F4 after you have already pressed Enter to finish the formula, Excel will not add the dollar signs. The shortcut only works while you are actively editing the formula in the formula bar or within the cell itself.

Another common mistake is forgetting that the F4 key has a dual purpose. In many contexts, F4 is the "Repeat" command, which repeats the last action you took (like highlighting a cell yellow). If you are not currently inside a formula, pressing F4 will simply repeat your last formatting or editing action rather than adding absolute references. Always ensure you are in "Edit Mode" by double-clicking the cell or clicking into the formula bar first.

Users often confuse the different types of mixed references. It is easy to accidentally lock the row (B$2) when you intended to lock the column ($B2). If you see your formula producing incorrect results when dragged horizontally, you likely locked the row instead of the column.

Tips

To speed up your workflow, use F4 when creating a "Constant Table." For example, if you have a sales tax rate in cell H1 and a list of prices in column A, you can write =A2*$H$1. By using F4 on H1, you can drag that formula down for thousands of rows without having to manually type the dollar signs for every single cell.

If you are working with a very large formula containing multiple references, you can highlight a specific part of the reference in the formula bar with your mouse before pressing F4. This ensures Excel knows exactly which coordinate you are trying to lock without you having to navigate the cursor carefully with the arrow keys.

When creating complex grids, such as a multiplication table, use the mixed reference feature (pressing F4 twice or three times). By locking only the top row and only the left column, you can create a single formula that can be dragged across the entire grid to populate every cell correctly.

Troubleshooting

If pressing F4 does nothing, the most likely cause is the "Fn" (Function) key on your keyboard. Many modern laptops, especially those from Dell, HP, and Lenovo, have a default setting where the top row of keys controls hardware features (like volume, brightness, or airplane mode) instead of standard F-functions. If your F4 key has an icon of a microphone or a speaker on it, you must hold down the Fn key (usually located near the Ctrl key) while pressing F4.

If you are using a Mac, the behavior is similar. You may need to hold the fn key. Additionally, if you are using Excel on a web browser (Excel Online), keyboard shortcuts can sometimes conflict with browser shortcuts. Ensure your browser is not intercepting the F4 command. If it is, you can always manually type the dollar sign ($) before the column letter and row number.

If the dollar signs appear but the formula still gives an error, check for "Circular References." This happens if you accidentally lock a cell that is part of the range the formula is calculating. Ensure that your absolute reference is pointing to a static data point (like a tax rate or a date) and not to the cell where the formula itself resides.

Frequently Asked Questions

What exactly does the dollar sign do in Excel?

The dollar sign acts as a "lock." A standard reference like A1 is relative, meaning if you move the formula down one row, it becomes A2. Adding a dollar sign before the A ($A1) locks the column; adding it before the 1 (A$1) locks the row. Adding both ($A$1) locks the cell entirely regardless of where the formula is moved.

Can I use F4 on a Mac?

Yes, F4 works on macOS, though depending on your system settings, you may need to hold the fn key simultaneously. If the function keys are mapped to system controls (like Mission Control), the cmd + T shortcut is sometimes used in older versions, but F4 (with fn) remains the standard for modern Excel for Mac.

Is there a way to lock a whole range of cells at once?

The F4 shortcut only works on one reference at a time. If you need to lock a range (e.g., A1:B10), you must highlight the range within the formula and press F4. This will change it to $A$1:$B$10. You cannot select multiple separate cells and lock them all with one keystroke.

Why does F4 repeat my last action instead of locking the cell?

This happens because you are not in "Edit Mode." To use F4 for cell referencing, you must be actively typing a formula or have double-clicked into a cell to edit an existing formula. If you are just selecting cells on the sheet, F4 functions as the "Repeat Last Action" command.

Can I manually type the dollar signs instead of using F4?

Yes. Typing the $ symbol manually is exactly the same as using the F4 shortcut. The shortcut is simply a time-saving tool to avoid switching between the letter/number keys and the symbol key.

Does F4 work in Google Sheets?

Yes, Google Sheets uses the same logic as Excel. Pressing F4 while editing a cell reference will cycle through absolute and mixed references in the same order as Microsoft Excel.