How to Undo in Excel With a Keyboard Shortcut on Windows

How-to basics · Updated November 20, 2026

To undo your most recent action in Excel for Microsoft 365 on Windows, press Ctrl+Z. Press the shortcut again to undo earlier actions in sequence. If you undo too much, press Ctrl+Y to redo the last action you reversed. You need an open workbook with an action Excel can undo; the shortcut works in desktop Excel and Excel for the web, although Mac uses different keys.

What You’ll Need

  • An open Excel workbook containing the change you want to reverse.
  • A keyboard. On Windows, use Ctrl+Z; on a Mac, use Command+Z.
  • A saved copy of important work if you are unsure what the undo will affect. Undo changes the workbook itself, so check the result before continuing.

Step-by-Step

  1. Finish the action you want to undo. If you have just typed into a cell, press Enter or click another cell to commit the edit. If you are still editing the cell and have not committed the change, press Esc to cancel that in-progress edit instead. Once the change is committed, Excel can treat it as an action in the undo history.
  2. Check that the correct workbook is active. Click inside the workbook where the unwanted change occurred. Excel maintains undo history for the current working session, and switching to a different workbook can change which actions are available. If you have several workbooks open, look at the workbook window or title bar before using the shortcut.
  3. Press Ctrl+Z once. This reverses the latest undoable action in the active workbook. For example, if you entered a value in cell B4 and then pressed Enter, one press generally removes that newly entered value and restores the cell’s prior state. If the last action was formatting a range, Excel reverses that formatting action instead. The shortcut does not mean “clear the selected cell”; it reverses the most recent action, wherever that action took place.
  4. Inspect what changed before pressing it again. Check the relevant cells, formulas, formatting, or sheet structure. If the result is not what you expected, avoid repeating the shortcut automatically. Undo follows the action history, not the current selection, so the action being reversed may involve a different area from the one currently highlighted.
  5. Repeat Ctrl+Z to step farther back. Each press reverses the next available action in the history. If you pasted data and then changed a cell’s number format, the first press reverses the formatting change; another press may reverse the paste. Go one step at a time and inspect the workbook as you go, especially when the actions affected multiple cells or worksheets.
  6. Use the Undo list if you need to review recent actions. Excel may show an Undo button on the Quick Access Toolbar, commonly near the top-left of the window. Select its small drop-down arrow to see available actions. Choosing an earlier action in the list also undoes the actions above it in the list, so it can reverse several steps at once. The list is useful for understanding the sequence, but it is not a way to undo one older action while keeping later actions intact.
  7. Redo if you reversed too far. Press Ctrl+Y to redo the most recently undone action. You can press it again to redo additional actions, provided you have not made a new change that replaces the redo path. Check the workbook after each redo so you stop at the state you want. The Redo button on the Quick Access Toolbar is another option when it is visible.
  8. Save after confirming the result. Once the workbook looks right, press Ctrl+S to save. Saving normally does not prevent you from undoing later actions in the same open session, but closing the workbook ends that session’s regular undo history. Do not close and reopen a file expecting Ctrl+Z to reach edits from before it was closed.

On a Mac, use Command+Z for Undo and Command+Y for Redo in Excel. Some Mac keyboard layouts or versions may also offer a Redo command from the menu or toolbar, so use the displayed command if the shortcut differs. In Excel for the web, Ctrl+Z is the Windows shortcut; on a Mac browser, use Command+Z. If a browser or remote-desktop setup intercepts a key combination, click the Undo button in Excel instead.

Common Mistakes

  • Pressing Undo repeatedly without checking. A series of presses can remove more than the unwanted change, including a paste, a format change, or an earlier entry. Use one press, inspect the workbook, and continue only if the next reversal is intended.
  • Assuming Undo applies to the selected cell. The selection does not determine which action is undone. Excel reverses the latest undoable action in the workbook, which may have affected another range or sheet.
  • Trying to undo an edit that is still in progress. If the cell is actively being edited, Esc is usually the direct way to cancel the uncommitted edit. Pressing Enter first commits it; then Undo can reverse that completed edit.
  • Using Undo after a new action when you meant Redo. Redo is available after undoing, but making a fresh edit can discard the redo sequence. If you undid too much, press Ctrl+Y before typing, pasting, or changing formatting again.
  • Expecting every operation to be reversible. Some commands and external actions do not appear in Excel’s undo history. Macros, for example, generally clear the undo history, and their effects cannot be reversed with Ctrl+Z. Save a separate copy before running a macro or any operation whose reversibility is uncertain.
  • Expecting the history to survive closing the workbook. Excel’s regular Undo list is not a permanent change log. Once a workbook is closed, the session’s undo history is unavailable, even if the workbook was saved.

Tips

  • Use the status and toolbar cues. The Undo button may display the name of the action it will reverse when you point to it. Its drop-down list can help identify whether the latest action was typing, deleting, or formatting. If the button is unavailable or its list is empty, Excel has no applicable action in the current undo history.
  • Make a checkpoint before large edits. Save the workbook before bulk pasting, deleting rows, or applying broad formatting. For extra protection, use Save As to create a separate copy. This gives you a fallback if an operation cannot be undone or you discover the problem after closing the file.
  • Remember that Undo is chronological. It is not a selective history editor. If you need to reverse an older change but keep later changes, consider whether redoing or re-entering the later work is practical. For important files, compare against a saved copy rather than undoing a long chain blindly.
  • Choose the right key for your device. Windows uses Ctrl; Mac uses Command. On a laptop, you generally do not need an extra function key. If using a remote Windows session from a Mac, the remote-desktop app’s keyboard settings may affect which computer receives the shortcut.
  • Be careful with shared files. In a workbook shared through OneDrive or SharePoint, edits from other people can appear while you work. Undo is for actions in your editing history, not a general command to roll back another person’s work. Coordinate before changing shared data, and use version history when you need to review an earlier saved state.

Troubleshooting

Nothing happens when you press Ctrl+Z. First click a cell in the correct workbook and try again. Confirm you are using the Windows key combination, not Command+Z. If the Undo button is disabled, the action may already have been undone, the workbook may have been reopened since the change, or Excel may not have recorded the operation as undoable. Try the Undo button on the Quick Access Toolbar to see whether Excel offers an available action.

The wrong change was reversed. Press Ctrl+Y immediately to redo it, then inspect the workbook. If you have already made another edit, the redo option may no longer restore the prior state. In that case, use a saved copy or the file’s available version history to recover data, rather than continuing to press Undo and hoping to isolate one change.

Undo reverses several things, or the list is confusing. Undo is sequential. A single press reverses one recorded action, but one action—such as pasting a block—can affect many cells. Open the Undo drop-down if available and read the action labels before selecting an older point. Remember that selecting an older entry also reverses the intervening actions. If the sequence is unclear, save a copy first and use that copy to investigate.

The shortcut types a character or behaves unexpectedly. Check whether a cell, formula bar, dialog box, or another application has focus. Press Esc to leave an active cell edit or close a dialog when appropriate, then click the worksheet and try the correct shortcut again. In Excel for the web, the browser or an extension can sometimes capture keyboard input; use Excel’s on-screen Undo control as a workaround.

You cannot undo a macro or an action after reopening. Excel’s standard undo stack cannot restore every operation, and running VBA commonly clears the stack. If a macro changed the workbook, close without saving only if you are certain you do not need any other unsaved work; otherwise restore a backup or an earlier cloud version. For future runs, save a separate workbook copy before running macros.

Frequently Asked Questions

What is the keyboard shortcut to undo in Excel?
On Windows, press Ctrl+Z. On a Mac, press Command+Z. Each press reverses the next available action in the active workbook’s history.

How do I redo an action in Excel?
On Windows, press Ctrl+Y; on a Mac, press Command+Y. Redo restores an action you just undid. If you make a new edit after undoing, the redo path may be lost.

Can I undo several actions at once?
Yes. Press Ctrl+Z several times, or choose an earlier item from the Undo drop-down on the Quick Access Toolbar if it is available. Excel also reverses every action between the chosen item and the latest one, so inspect the list before selecting.

Can I undo after saving an Excel file?
Usually, saving does not erase the current session’s undo history, so you can still undo eligible actions while the workbook remains open. Closing and reopening the workbook ends that regular history. A saved file’s version history or a backup may help recover an earlier state.

Why is Undo greyed out in Excel?
There may be no undoable action in the current session, the workbook may have been reopened, or a command such as a macro may have cleared the undo history. Confirm the correct workbook is active and check whether the Undo button or its drop-down offers an action.

Does Ctrl+Z work in Excel for the web?
Yes. In a Windows browser, use Ctrl+Z; on a Mac, use Command+Z. If the browser captures the shortcut, click Excel’s Undo button instead.

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.