Excel Undo Shortcut: How to Reverse Changes Safely

How-to basics · Updated November 20, 2026

In Excel for Microsoft 365 on Windows, press Ctrl+Z to undo your most recent action. On a Mac, press Command+Z. Press the shortcut again to undo earlier actions, or use the Undo button on the Quick Access Toolbar.

Windows and Mac keyboard shortcuts

Undo reverses a recent action in the workbook, such as entering a value, changing a formula, applying formatting, or deleting a range. The shortcut is easy to use while a worksheet is active: press the keys once, check the result, and repeat if you need to step back further. Excel does not require you to select the changed cell first.

  • Excel for Windows: Ctrl+Z
  • Excel for Mac: Command+Z
  • Excel for the web: Ctrl+Z on Windows or Command+Z on Mac

On Windows, hold down Ctrl and tap Z. On a Mac, hold down Command and tap Z; the Command key is marked with the ⌘ symbol on most Apple keyboards. If the shortcut appears not to work, check that Excel has focus and that you are not typing into a dialog box or another app. In Excel for the web, click in the workbook first if the browser has focus elsewhere.

You can also select Undo, shown as a curved left-pointing arrow, on the Quick Access Toolbar. Its position can vary depending on how the toolbar is configured, but it is commonly near the top of the Excel window. The button is useful if you are not sure which keys your device uses or want to see the action Excel is about to reverse.

What Excel’s Undo command reverses

Excel keeps a history of many recent changes made during your editing session. Undo moves backward through that history, reversing the latest recorded action first. For example, if you type a number into B4, apply bold formatting to B4, and then change its fill color, the first Undo reverses the fill-color change. The next reverses bold formatting, and another can reverse the original entry.

Common worksheet actions that are generally undoable include typing or replacing cell contents, changing formulas, applying formatting, inserting or deleting rows and columns, and sorting or editing many kinds of data. The exact action matters: Excel can reverse a recorded change, but it cannot necessarily restore information that was never part of the undo history or that has been changed outside the current editing session.

Undo is not the same as clearing a cell. If you press Delete or use a clear command, Excel may record that action so Ctrl+Z can restore the contents or formatting it removed. If you use Undo afterward, however, Excel reverses the clear operation; it does not simply erase the current cell again. Think of Undo as moving backward through a sequence of actions, not as a command to remove whatever is selected.

For a formula, Undo reverses the act of entering or changing the formula; it does not alter the formula’s logic selectively. If a result looks wrong, undoing can restore the previous formula or value, but it will not explain why the result was wrong. Once the original is restored, inspect the formula, references, and input values before making another change.

Undo several actions and view the action list

To reverse several recent actions with the keyboard, press Ctrl+Z repeatedly on Windows or Command+Z repeatedly on Mac. Each press typically undoes one action in the recorded sequence. Pause after a few presses to check the sheet, especially if the actions affected different cells or included formatting and data changes.

For a longer sequence, use the Undo history list. Select the small arrow next to Undo on the Quick Access Toolbar, then choose an action from the list if that list is available in your Excel version. Choosing an older point in the list reverses that action and the newer actions above it in the sequence; it does not undo only that one selected action while leaving later changes in place. Read the list carefully before selecting an entry.

  1. Open the Undo list using the arrow beside the Undo button.
  2. Look for the point in the recent action sequence you want to return to.
  3. Select that point and inspect the worksheet to confirm the changes were reversed as expected.

If you undo too much, do not make another edit immediately. Use Redo to move forward again through the actions you just reversed. Starting a new action after undoing can change what is available to redo, so check the result before continuing with other edits.

Redo, repeat, and the difference between them

Redo reapplies an action that you have just undone. In Excel for Windows, press Ctrl+Y or select the Redo button when it is available. On a Mac, Command+Y is the usual redo shortcut. The button may be unavailable when there is no undone action waiting to be reapplied.

Redo is useful when you press Undo by mistake. For instance, if you undo a format change and realize that it was the correct change, use Redo to put it back. You can usually redo several undone actions in sequence, just as you can undo several actions. The visible Redo button or its menu can help you confirm that Excel has something to restore.

Do not confuse Redo with repeating an action. In some Excel situations, Ctrl+Y on Windows can repeat the last command when there is no undone action to redo. Whether a command can be repeated depends on the action. Redo specifically moves forward in the undo history; repeating performs the previous operation again on the current selection. If the result is not what you intended, use Undo promptly and check which command Excel applied.

Why Ctrl+Z may not work

If Undo is unavailable, disabled, or does not restore the change you expected, first check that the workbook window is active and that the change you want to reverse was the most recent recorded action. An action in another program, a different workbook window, or a dialog may mean Excel is not undoing the step you had in mind. The Undo list can make the sequence clearer when the toolbar shows recent actions.

Some actions cannot be undone through Excel’s normal history, and certain operations can clear or interrupt the available undo sequence. A particularly important example is running a VBA macro: Excel clears its undo history when a macro runs, so Ctrl+Z cannot reverse the macro’s effects. Some actions involving external processes or features may also be outside the normal worksheet undo history. If the Undo button is greyed out, Excel has no applicable recorded step to reverse at that point.

Before an operation that could be difficult to reverse, save a separate copy of the workbook or use another recovery method appropriate to the file. Saving a copy is different from relying on Undo: it gives you a separate version to return to if a change cannot be reversed. For an existing file stored in OneDrive or SharePoint, version history may also offer a way to view or restore an earlier saved version, depending on the account, file location, and available history.

If a cell is being edited and you have not yet committed the entry, pressing Esc can cancel the current edit rather than undoing an earlier completed worksheet action. That distinction can help when you have started typing a replacement but have not pressed Enter. If you already committed the change, use Undo to return to the previous state.

Excel for the web and shared workbooks

Excel for the web uses the same basic undo idea: Ctrl+Z on Windows and Command+Z on Mac. It also provides Undo and Redo controls in the interface. If a shortcut appears to affect the browser rather than the workbook, click a worksheet cell and try again. The web app runs inside a browser, so focus and browser-level shortcuts can matter.

In a workbook shared through OneDrive or SharePoint, distinguish your own recent edits from changes made by other people. Undo is intended to reverse your own action in the workbook’s editing history; it is not a general command to erase a collaborator’s work. If several people are editing at once, check the affected cells and communicate before making a broad correction, particularly when a range has been sorted, filled, or overwritten.

Undo is also different from restoring a previous file version. Undo steps backward through recent actions in the open editing session. Version history, when available, lets you inspect or restore an earlier saved state of the workbook. Consider the effect on other collaborators before restoring a whole version, because that can replace more than one cell’s changes.

Safer ways to recover important data

For ordinary mistakes, Undo is usually the quickest recovery tool. For changes that involve many cells, formulas, or shared work, take a moment to confirm what will be reversed. A simple routine can reduce the chance of making the problem worse:

  • Stop editing as soon as you notice the mistake; new actions can complicate the undo sequence.
  • Use Undo once, then inspect the affected cells before pressing it again.
  • Use Redo if the last undo removed a change you meant to keep.
  • For a macro, bulk operation, or uncertain recovery, work from a saved copy or check whether file version history is available.

If the mistake is limited to one cell and you know the correct value, you can type that value again rather than undoing unrelated later work. This is often preferable when the mistaken action is no longer the latest step in the history. For a formula, copy the correct formula from a reliable neighboring cell only after checking that its relative and absolute references will behave as intended.

Be cautious about using Undo repeatedly without checking the sheet. A sequence might include changes you want to keep, such as a corrected label or a formatting adjustment made after the original mistake. Undo works in order, so it cannot skip an unwanted action and preserve a newer action in the same sequence. If you need a selective fix, editing the affected cells directly or restoring from a copy may be safer.

Frequently Asked Questions

What is the keyboard command to undo in Excel?
Press Ctrl+Z in Excel for Windows, or Command+Z in Excel for Mac. In Excel for the web, use the shortcut for your operating system after focusing the workbook.

How do I undo more than one action in Excel?
Press Ctrl+Z or Command+Z repeatedly, or open the arrow beside Undo on the Quick Access Toolbar and choose an earlier point in the action list. Selecting an earlier point also reverses the newer actions in that sequence.

What is the redo shortcut in Excel?
Use Ctrl+Y on Windows or Command+Y on Mac to redo an action you have undone. Redo is available only when Excel has an undone action to reapply; on Windows, Ctrl+Y can also repeat certain commands in other situations.

Can I undo a macro in Excel?
Usually not with Ctrl+Z. Running a VBA macro clears Excel’s normal undo history, so save a separate copy before running a macro that changes workbook data or structure.

Why is Undo greyed out in Excel?
Undo is greyed out when Excel has no applicable recorded action to reverse. The change may not be part of the undo history, or an operation such as running a macro may have cleared that history.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.