In Excel for Microsoft 365 on Windows, press F4 to repeat the last action when Excel can repeat it; Ctrl+Y can also repeat an action, or redo one you just undid. The key distinction is context: F4 inside a formula may change cell references instead, and not every Excel command is repeatable.
The Shortcut for Repeating an Action
F4 is the familiar repeat shortcut in desktop Excel for Windows. It is useful when you have completed an operation and want to apply that same operation again without reopening a command or repeating every step. For instance, after applying a particular fill color to one cell, you can select another cell and press F4 to apply the same formatting there, provided the operation is still Excel’s last repeatable action.
Ctrl+Y is another key combination to know. Excel uses it to redo an action that was undone, and in situations where there is nothing to redo, it can repeat the previous action if that action supports repetition. So if you are asking how to repeat an action, try F4; if you are restoring something you just undid, use Ctrl+Y.
Neither key is a universal replay button. Excel decides whether a command can be repeated, and the current selection and editing context matter. If the shortcut appears to do nothing, the command may not support repetition, focus may be in a formula or text-editing area, or the key may be intercepted by your keyboard or operating system.
How to Repeat the Last Action
To repeat an operation on another cell or range, finish the first operation, select the next target, and press F4. The target should be selected before you press the shortcut. Here is a practical sequence:
- Select a cell or range and perform an operation, such as changing its fill color using Home > Fill Color.
- Select a different cell or range where you want the same operation applied.
- Press F4 once. Check the result before continuing, especially if the second selection is a different size or shape.
The repeat command applies an operation, not necessarily a saved recipe that understands your intent. For example, if you set a cell’s font color to red and then press F4 on a different cell, Excel may apply that same formatting change. It will not infer that you wanted a related but different format, such as a red fill instead of red text. Select the appropriate destination first, and verify the outcome.
Repetition can also help with repeated structural edits. If an operation such as inserting a row is available to repeat, you can select another suitable row and press F4. The exact result depends on what you selected and which operation Excel retained as repeatable. If it does not repeat as expected, use the ribbon command again rather than assuming the shortcut will reproduce every menu action.
Repeat, Redo, and Undo Are Different
These commands are easy to confuse because Ctrl+Y has more than one role. Undo reverses a recent change; redo restores a change that was undone. Repeating an action performs the previous operation again on a new target. Ctrl+Z is the usual undo shortcut on Windows, while Ctrl+Y is redo and can also serve as repeat when there is no undone action waiting to be restored.
Consider a sequence in which you color a cell, undo that color with Ctrl+Z, and then press Ctrl+Y. Excel is redoing the color change you just reversed. That is different from selecting an unrelated cell and asking Excel to apply a previous formatting operation again. F4 is often the more straightforward choice for the latter, as long as the operation can be repeated.
This distinction explains why Ctrl+Y may seem inconsistent. After an undo, it is naturally associated with redo. At another point, it may repeat the last action instead. When your goal is specifically to repeat an operation on another target, F4 is a useful first choice on Windows; when your goal is to reverse an undo, Ctrl+Y is the appropriate redo command.
Examples of Actions That May Repeat
Repeat is most useful for small, repeated edits where the same command should be applied to multiple targets. Common examples include formatting changes and certain worksheet-structure operations. Whether a particular command repeats can depend on the command and the workbook context, so treat the examples as practical possibilities, not a guarantee for every Excel build or selection.
- Cell formatting: Apply a border, font change, number format, or fill change to one cell, then select another target and try F4.
- Repeated edits: Make a suitable change to one selected cell, then try repeating it on another cell if the action is supported.
- Worksheet structure: Some insert or delete operations can be repeated after you select an appropriate next row, column, or range.
For example, suppose you use the ribbon to apply a bottom border to a heading cell. After selecting another heading cell, F4 may apply the same border operation. It does not decide which cells should be headings or locate them for you; you must select the next target yourself. If the range or target differs, inspect the result because repeated commands may affect a larger area than intended.
For changes that need to be applied consistently across many cells, repeating one command may not be the best tool. Format Painter, cell styles, or selecting multiple targets before applying a format can be more efficient. The right method depends on whether you want to copy one format, reuse a specific operation, or apply a change to a known group of cells.
Why F4 Sometimes Changes a Formula
F4 has a separate, well-known job while you are editing a formula: it cycles through reference types for a cell reference. For example, while entering or editing a formula, placing the insertion point on a reference and pressing F4 can switch between relative, absolute, and mixed references. A reference such as A1 can change to $A$1, then to A$1 or $A1 as you cycle through the available forms.
This is not the same as repeating the last worksheet action. Excel interprets F4 according to what you are doing at that moment. If the formula bar or cell is in edit mode, the key may modify the reference rather than repeat formatting. Press Enter or Esc to leave formula editing, select the next destination, and then try F4 if you meant to repeat an operation.
The distinction is particularly useful when copying formulas. A relative reference adjusts when a formula is filled or copied; an absolute reference marked with dollar signs stays fixed. F4 can help change the reference while constructing the formula, but it does not repeatedly copy the formula into another cell as a general-purpose replay command. Use fill or copy-and-paste when your goal is to propagate a formula.
Windows, Mac, and Excel for the Web
This guidance is for Excel for Microsoft 365 on Windows. On a Mac, Command+Y is the usual redo or repeat shortcut in Excel, while the behavior of F4 can depend on the keyboard, function-key settings, and whether you are editing a formula. Some Mac keyboards require Fn with a function key to send the F4 command. If a Mac shortcut does not behave as expected, check Excel’s keyboard-shortcut help for the installed version and distinguish formula editing from repeating an action.
Excel for the web runs in a browser, so keyboard shortcuts can also interact with browser or operating-system shortcuts. Ctrl+Y on Windows or Command+Y on Mac is commonly used for redo, but support for repeating a particular action can differ from desktop Excel. If F4 is unavailable or behaves differently in the browser, use the ribbon command again or open the workbook in the desktop app for the repeat behavior you need.
On Windows laptops, F4 may share a key with a hardware function such as volume or screen brightness. If a plain F4 press changes a hardware setting or has no effect in Excel, try Fn+F4. The Fn key behavior is set by the laptop’s keyboard or firmware and is not an Excel preference, so it can vary between devices.
Common Problems and How to Fix Them
If F4 seems not to repeat anything, first confirm that you have completed the previous command and selected a new destination. A selection inside a cell, formula bar, dialog, or other editing field can change what the key does. Press Enter to finish an edit, click the intended cell or range, and try again.
Also consider whether another action has replaced the operation you meant to repeat. Repeat refers to the most recent eligible action, not an operation you can choose from a history list. If you perform another command in between, F4 may repeat that command instead, or there may no longer be a repeatable action. Reapply the desired operation once, then select the next target and use the shortcut immediately.
Use this quick checklist when the result is unexpected:
- Make sure Excel, rather than another app or a dialog, has keyboard focus.
- Leave formula or cell-edit mode before using F4 for repetition.
- On a laptop, try Fn+F4 if the function key is assigned to a hardware feature.
- Check whether the operation itself can be repeated; some commands cannot.
- Use Ctrl+Y only with the understanding that it may redo an undone change rather than repeat a fresh action.
If the repeated change affects the wrong cells, use Ctrl+Z promptly to undo it, then select the intended range and repeat the operation. Before repeating a structural change such as inserting or deleting cells, check the selection carefully: an operation applied to the wrong row or column can shift surrounding data.
When Another Method Is Better
F4 is convenient for repeating one eligible action, but it is not always the most reliable or efficient way to standardize a workbook. If you need to apply the same formatting to several nonadjacent cells, select the targets together when possible and apply the formatting once. For copying the appearance of one cell to another, Home > Format Painter can be more explicit. For reusable sets of formatting, consider cell styles.
For adjacent cells, the Fill commands or dragging the fill handle may be more appropriate, especially when you need to extend a series or copy a formula. For repeating a data-entry value, copy and paste may be clearer than relying on an action-repeat shortcut. These alternatives make the intended operation visible and can avoid uncertainty about which command Excel considers the last repeatable one.
The practical rule is simple: use F4 for a quick repeat of a recent, supported command; use Ctrl+Y to redo an undone action; and use the ribbon, fill tools, or copy-and-paste when the task needs a deliberate range-wide result. Choosing the right method reduces accidental formatting and makes the workbook easier to check.
Frequently Asked Questions
What key repeats the last action in Excel?
In Excel for Microsoft 365 on Windows, press F4 after selecting the next target. Ctrl+Y can also repeat an eligible action when it is not being used to redo an undone change.
Does Ctrl+Y repeat or redo in Excel?
It can do either. After you undo an action, Ctrl+Y redoes it. When there is no undone action to restore, Excel may use Ctrl+Y to repeat the last action if that operation is repeatable.
Why does F4 put dollar signs in my formula?
When you are editing a formula, F4 cycles the selected cell reference through relative, absolute, and mixed forms. Finish editing and select a worksheet target before using F4 to repeat an action.
Can Excel repeat every command?
No. Repeat works only for actions Excel supports in the current context. If F4 does nothing, use the original ribbon command again or choose another method such as Format Painter or copy-and-paste.
What is the repeat shortcut in Excel for Mac?
Command+Y is the usual redo or repeat shortcut in Excel for Mac. F4 behavior can depend on the Mac keyboard and function-key settings; Fn may be needed, and F4 behaves differently during formula editing.
Related
- Excel: Insert a Checkbox Without the Developer Tab
- Excel Insert Image Based on Cell Value: How It Works
- Excel Indian Number Format: Lakhs, Crores, and Commas
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Print Area Lines: How to View, Set, and Hide ThemYes. In Excel for Microsoft 365 on Windows, the clearest way to see your print area is to…
- Google Sheets Add Timestamp When a Cell ChangesYes. To add a fixed timestamp when a cell changes in Google Sheets, use a small Apps Script…
- Future Out of Office in Outlook: How to Schedule ItTo schedule a future out-of-office reply in Outlook, open Automatic Replies, turn on the option to send replies…
- Outlook Distribution Lists: How to Create and Manage ThemYes. You can create a personal distribution list in Outlook—called a contact list in new Outlook and Outlook…
- How to Lock Cells in Excel With a PasswordTo lock cells in Excel with a password, first unlock any cells people should still be able to…
- Goal Seek in Excel: A Practical SampleTo use Goal Seek in Excel, create a formula, then choose Data > What-If Analysis > Goal Seek.…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.