F4 in Excel does two different jobs depending on when you press it. When you are editing a formula and the cursor is on a cell reference, F4 cycles that reference through the four reference types: absolute ($A$1), absolute row relative column (A$1), relative row absolute column ($A1), and back to relative (A1). When you are not editing a formula, F4 repeats your last action, which is handy for quickly reapplying formatting or inserting rows. On some laptops you may need to hold Fn as well. There is also a lesser-known use: pressing F4 after selecting a shape or chart opens its Format pane, and Ctrl+F4 closes the active workbook window.

What You'll Need

  • Excel for Windows or Excel for Mac (the shortcut differs slightly on Mac; see the steps).
  • A workbook open with at least one formula or a recent action to repeat.
  • On many laptops, the Fn key, because the top row defaults to media or brightness controls.

Step-by-Step

  1. Understand the two modes. F4 behaves differently depending on whether you are inside the formula bar or not. The reference-cycling behavior only works while you are editing a formula. The repeat-last-action behavior works when you are not editing.
  2. Cycle a cell reference. Click the cell containing your formula, press F2 (or click into the formula bar) to enter edit mode, and place the cursor next to or inside a reference such as A1. Press F4 once and it becomes $A$1 (absolute). Press again for A$1 (row locked), again for $A1 (column locked), and again to return to A1. This is the fastest way to lock a reference before you copy a formula down or across.
  3. Repeat your last action. Press Esc to leave edit mode, then press F4. Excel repeats the last command you performed, such as applying a fill color, bolding text, or inserting a row. Select a different cell or range first and press F4 again to apply the same action there.
  4. Open the Format pane. Select a chart, shape, image, or SmartArt object and press F4. The Format pane opens on the right so you can adjust fill, outline, and effects. Press F4 again to close it.
  5. Close a workbook window. Press Ctrl+F4 to close the active workbook without closing Excel itself. If there are unsaved changes, Excel prompts you to save first.
  6. Use the Mac equivalent. On Excel for Mac, the reference-cycling shortcut is Cmd+T (not F4). The repeat-last-action shortcut is Cmd+Y. On Mac keyboards, F4 may be assigned to Mission Control or another system function, so check System Settings > Keyboard if it does not respond.
  7. Enable the Fn key on a laptop. If pressing F4 changes screen brightness or volume instead, hold Fn+F4. Many laptops have a Fn Lock (often Fn+Esc) that makes the function keys behave as F1–F12 by default.

Common Mistakes

  • Pressing F4 outside edit mode and expecting reference cycling. If you are not editing a formula, F4 repeats your last action instead. Press F2 first.
  • Cycling past the reference type you want. F4 cycles through four states. Keep pressing until you see the dollar signs in the right places, or press it four times to return to where you started.
  • Assuming F4 works the same on Mac. The reference-cycling shortcut is Cmd+T on Mac, and F4 may be captured by macOS. Use the Mac shortcuts above.
  • Forgetting Fn on laptops. If nothing happens, the top row is probably set to media keys. Hold Fn or enable Fn Lock.
  • Using F4 to repeat an action that cannot be repeated. Some commands, such as certain dialog-driven operations, are not repeatable. Excel simply does nothing.

Tips

  • Use F4 while building a formula to lock a reference before copying it. For example, in =A1*B1, press F4 on A1 to make it $A$1 so the column and row stay fixed when you fill down.
  • Combine F4 with Ctrl+Z. If you repeat an action by mistake, undo it immediately.
  • On Windows, F4 also works in the Name Box and in the Go To dialog (Ctrl+G) to cycle through reference types.
  • If you use F4 often for formatting, record the action once, then use F4 to apply it to many ranges quickly.
  • Check your keyboard's Fn Lock setting once; it saves you from holding Fn every time.

Troubleshooting

  • F4 does nothing. Confirm you are in edit mode for reference cycling, or that you have a repeatable last action for repeat mode. On a laptop, try Fn+F4.
  • F4 changes brightness or volume. Your laptop's top row is set to media keys. Hold Fn or enable Fn Lock.
  • F4 cycles references but not the one you want. Place the cursor directly on the reference, not on a function name or operator, then press F4.
  • F4 opens the Format pane unexpectedly. You have an object selected. Click a cell first, then press F4.
  • Mac: F4 does something else. macOS may assign F4 to Mission Control or Launchpad. Use Cmd+T for reference cycling and Cmd+Y for repeat, or remap the key in System Settings > Keyboard.
  • Excel is unresponsive to all function keys. Save your work, close and reopen Excel, and check for updates. If the problem persists, test another keyboard to rule out a hardware issue.

Frequently Asked Questions

What does F4 do in Excel?

It cycles a cell reference through absolute and relative types while you edit a formula, and repeats your last action when you are not editing. It can also open the Format pane for a selected object.

Why does F4 not lock my cell reference?

You must be in edit mode with the cursor on the reference. Press F2 first, then F4. On a laptop, hold Fn+F4.

What is the F4 equivalent on Mac?

Cmd+T cycles reference types, and Cmd+Y repeats the last action. F4 itself may be assigned to a macOS function.

Can I use F4 to repeat formatting?

Yes. Apply the formatting once, select another range, and press F4 to repeat it. Not every command is repeatable.

Does F4 work in Excel Online?

Excel for the web supports some function keys, but behavior varies by browser. If F4 does not work, use the formula bar and type the dollar signs manually.

What does Ctrl+F4 do?

It closes the active workbook window without closing Excel. You are prompted to save unsaved changes.