What F4 Does in Excel (Windows and Mac)
By ExcelReady TeamUpdated 5 min read
The short answer
F4 in Excel has two jobs. While you edit a formula, it cycles the reference at the cursor through A1, $A$1, A$1 and $A1, adding or removing $ signs. When you are not editing, it repeats your last action on Windows, such as inserting a row. On a Mac, use fn+F4 or ⌘T for references and ⌘Y to repeat.
Key takeaways
- While editing a formula, F4 cycles a reference: A1, $A$1, A$1, $A1, then back to A1.
- When not editing, F4 repeats the last action on Windows, the same as Ctrl+Y.
- On a Mac, fn+F4 or ⌘T toggles references and ⌘Y repeats the last action.
- On many laptops, F4 controls the screen or sound unless you hold Fn or turn on Fn Lock.
- Careful: Alt+F4 closes Excel and Ctrl+F4 closes the workbook window.
On this page+
F4 in Excel does two useful things, depending on what you are doing. While you edit a formula, it adds $ signs to a cell reference so the reference stays fixed when you copy. When you are not editing, it repeats your last action on Windows. This guide covers both jobs, the Mac equivalents, and why F4 sometimes seems to do nothing on a laptop.
What does F4 do in Excel?#
F4 behaves differently depending on whether a cell is in edit mode:
| Situation | What F4 does | Mac equivalent |
|---|---|---|
| Editing a formula, cursor on a reference | Cycles the reference through four types | fn+F4 or ⌘T |
| Not editing (a cell is just selected) | Repeats the last action (Windows) | ⌘Y |
Edit mode means you can see a blinking cursor inside the cell or the formula bar, after typing =, pressing F2 or double-clicking a cell.
How F4 adds $ signs to references#
While you edit a formula, put the cursor in or next to a reference and press F4. Each press moves to the next type:
| Press | Reference | What is locked |
|---|---|---|
| 0 | E1 | Nothing (relative) |
| 1 | $E$1 | Column and row (absolute) |
| 2 | E$1 | Row only (mixed) |
| 3 | $E1 | Column only (mixed) |
| 4 | E1 | Back to relative |
Here is the classic use. Prices are in B2:B4 and one tax rate of 20% is in E1. In C2, type =B2*E1. Before you press Enter, click on E1 in the formula and press F4 once:
=B2*$E$1Press Enter and the result is 10 (50 × 0.2). Fill the formula down with Ctrl+D (⌘D on a Mac), and C3 becomes =B3*$E$1 (7) and C4 becomes =B4*$E$1 (16). B2 moved, but E1 stayed fixed. Without the $ signs, C3 would point to E2, which is empty, and return 0.
To see why this matters, read the guide to Excel cell references. The two-press and three-press forms are mixed references, which lock only the row or only the column; see how to copy a formula without changing references for related tricks.
How to change every reference at once#
F4 changes only the reference at the cursor. To change several at once, select them in the formula bar first.
- Click the cell, then click in the formula bar.
- Select the whole formula text, or just the part with the references you want to change.
- Press F4. Every reference in the selection moves to the next type together.
This is handy for a formula like =SUMIF(A2:A20,G2,C2:C20) when you want to lock both ranges before filling down. Select the text from A2 to C20, press F4, then remove the $ signs from G2 if it should stay relative.
How F4 repeats your last action#
When you are not editing a cell, F4 repeats the last thing you did. It works for many formatting and editing actions:
- Insert a row: insert one row, then click elsewhere and press F4 to insert another.
- Delete a column: delete one, select the next and press F4.
- Apply formatting: fill one cell yellow, then select another cell and press F4.
On Windows, Ctrl+Y does the same thing when there is nothing to redo. On a Mac, use ⌘Y. Not every action can be repeated. If F4 does nothing, use the ribbon or the action's own shortcut again. The guide to editing cells, undo and redo explains how repeat fits with undo and redo, and how to insert and delete rows and columns has the shortcuts that pair well with F4.
Why is F4 not working?#
If F4 does nothing, or changes your screen brightness, one of these is usually the cause:
- Laptop function keys. Many laptops use the top row for brightness, volume or other features. Hold Fn and press F4, or turn on Fn Lock (often Fn+Esc, but it varies by brand).
- Mac function keys. Hold fn, use ⌘T, or tick "Use F1, F2, etc. keys as standard function keys" in macOS keyboard settings.
- Not in edit mode. F4 only toggles references while you are editing. Press F2 first, or click in the formula bar.
- Cursor not on a reference. If the cursor is on a function name or a number, F4 has nothing to change.
- Nothing to repeat. Outside edit mode, F4 needs a repeatable last action.
F4 in a job test#
Excel tests often include a task that only works if one cell is locked, such as a commission rate, an exchange rate or a tax rate in a single cell. The fastest route is to type the formula, press F4 on the fixed reference, and fill down. Then click the last cell in the column and read its formula. If the fixed reference still points to the rate cell, you got it right. That one check catches the most common reference mistake before you hand in your answers.
Other F4 shortcuts to know#
F4 combines with other keys, and two of them close things:
| Shortcut (Windows) | What it does |
|---|---|
| Alt+F4 | Closes Excel (it asks to save first) |
| Ctrl+F4 | Closes the current workbook window |
| Shift+F4 | Repeats the last Find, like Find Next |
Shift+F4 is useful after you search for a word with Ctrl+F: close the dialog and press Shift+F4 to jump to each next match. The guide to Find and Replace in Excel covers the full search options.
Practise it#
F4 saves time only once it is a habit. Try the tax exercise on this page, then open the relative vs absolute references lesson to fill a formula down, watch it break, and fix it with $ and F4 in a live spreadsheet. For the editing side, the edit, clear and undo lesson has you fix cells, cancel edits and undo mistakes. Each step is checked instantly.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Work out the tax for each item using the single rate in E1. Click C2, type =B2*E1, put the cursor on E1, press F4 to make it $E$1, then press Enter. The answer is =B2*$E$1.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | ||||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 |
Tip: Lock the tax rate with $ signs so it stays on E1 when you fill down.
Practise this in a lesson
Frequently asked questions
What does F4 do in Excel?
While you edit a formula, F4 adds or changes the $ signs on the reference at the cursor. When you are not editing, it repeats your last action, like inserting a row or applying a fill colour.
What is the F4 shortcut on a Mac?
To toggle references, press fn+F4 or ⌘T while editing the formula. To repeat the last action, press ⌘Y.
Why is F4 not working in Excel?
On most laptops, F4 is a media or brightness key by default. Press Fn+F4, or turn on Fn Lock. Also check that you are editing the formula, with the cursor inside a cell reference.
How do I add $ to all references in a formula at once?
Select the whole formula text in the formula bar, then press F4. Excel changes every reference in the selection to the next type together.
What does Alt+F4 do in Excel?
Alt+F4 closes the Excel window on Windows. Excel asks to save unsaved changes first, but it's easy to press by mistake when you mean F4.