Excel Undo Shortcut: Ctrl+Z and How It Works

How-to basics · Updated November 19, 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 eligible actions, or click Undo on the Quick Access Toolbar.

The Excel undo shortcut

Undo reverses the latest action Excel can undo in the active workbook. For example, if you accidentally delete a value, change a cell’s format, or paste over a range, press Ctrl+Z right away to restore the previous state. On a Mac, use Command+Z instead. These are the standard shortcuts in the desktop versions of Excel; the exact action reversed depends on what you did most recently.

The shortcut is useful because it works without opening a menu or finding the affected cells. You can usually press it repeatedly to walk backward through several actions. Excel groups some operations into a single undo step, so the number of key presses may not match the number of individual cells that changed. A single paste into a large range, for instance, is typically undone as one operation rather than cell by cell.

If you are editing the contents of a cell rather than working on the worksheet, the shortcut may affect the text currently being edited. Press Enter to commit the edit or Esc to cancel it, then use Undo if you meant to reverse a completed worksheet action.

What Undo can reverse

Undo is designed for recent changes made in Excel, not as a general-purpose way to retrieve any past version of a file. It commonly reverses actions such as entering or deleting data, changing formatting, inserting or deleting rows and columns, and many cut, copy, paste, or sort operations. The action must still be represented in Excel’s undo history, and some operations are not undoable.

Consider a simple example: you select cell B4, type 125, and press Enter. If you notice that the value should have been 152, Ctrl+Z removes the new entry and restores the cell’s earlier content. You can then enter the correct value. If instead you applied a number format to a range and then typed a value in another cell, the most recent action is the typing; the first Ctrl+Z reverses that entry, and a second may reverse the formatting change.

Undo reverses an action; it does not explain what changed or let you choose a particular cell from a history timeline. If you want to inspect the effects of a change before keeping it, use Undo and then Redo to compare the two states. For recovery from a much older edit, use version history or a backup rather than expecting the undo stack to reach indefinitely into the past.

Using the Undo button

If you prefer not to use a keyboard shortcut, click the Undo button, usually shown as a curved left-pointing arrow on the Quick Access Toolbar. In Excel for Windows, that toolbar is near the top of the Excel window; its position can vary with the toolbar layout. In Excel for Mac, look for the Undo control in the toolbar. In Excel for the web, the Undo control is also available near the top of the window.

The button performs the same basic task as Ctrl+Z or Command+Z. In desktop Excel, the small arrow beside Undo can open a list of recent undoable actions. Where the list is available, selecting an earlier action generally undoes that action and the subsequent actions listed after it. This can be more convenient than pressing the shortcut many times, but it is still limited to Excel’s current undo history.

  • Use the Undo button for a visible, mouse-accessible way to reverse the latest action.
  • Use the adjacent history list, when available, to step back through several recent actions.
  • Use the keyboard shortcut when speed matters or when your hands are already on the keyboard.

Undo, Redo, and the order of actions

Undo moves backward through recent changes. Redo moves forward again after an undo, restoring an action you just reversed. In Windows Excel, press Ctrl+Y to redo; in Excel for Mac, press Command+Y. Excel for the web also provides Undo and Redo controls, and keyboard shortcuts can vary according to the browser and operating system.

For example, suppose you enter a value, apply bold formatting, and then delete a row. Pressing Ctrl+Z once reverses the row deletion. Pressing it a second time reverses the bold formatting. If you decide the formatting should remain, use Redo once to apply it again. The exact sequence depends on Excel’s grouping of operations, but the general rule is that undo and redo follow the recent action history rather than targeting a particular cell.

Redo is available only after you have undone something. If you undo an action and then make a new change, Excel may discard the redo path because the sequence has branched. In practical terms, do not expect to undo, make unrelated edits, and then redo the original sequence exactly as it was. If you are unsure whether an undo removed the right thing, inspect the workbook before continuing.

Limits of Excel’s undo history

Undo is not a substitute for saving or backing up a workbook. It applies to actions Excel has retained in its current undo history; it is not a permanent record of every change. Closing a workbook ends the practical opportunity to use that session’s sequence of undo actions. Reopening the file does not turn Ctrl+Z into a way to step back through changes from a previous session.

Macros are an especially important limitation. In ordinary VBA use, running a macro clears Excel’s built-in undo history, and Ctrl+Z cannot reverse the macro’s changes. Some developers can create custom undo behavior for a particular macro, but it is not automatic. Before running a macro that changes data, save a separate copy of the workbook or make another suitable backup.

Some commands and operations may not be undoable, and behavior can depend on the action and Excel environment. If Undo is unavailable, disabled, or does not restore what you expected, avoid making further edits until you assess the workbook. Repeating Ctrl+Z without checking can reverse additional valid work. For valuable files, use version history, a backup, or another recovery option instead of relying on an assumed unlimited undo stack.

When to use version history or a backup

Use Undo for an immediate mistake in the current editing session. Use version history when the unwanted change is older, the workbook has been closed, or the undo history no longer contains the needed state. For a file stored in OneDrive or SharePoint, version history may let you review and restore an earlier saved version, subject to the file’s storage and account settings. The exact controls can differ between desktop Excel and the web.

Restoring an older version can replace newer work, so inspect the version date and contents before choosing it. If you only need information from an earlier copy, consider opening or downloading that version separately and copying the required material into the current workbook. This helps preserve edits made after the older version was saved.

For locally stored files, recovery options depend on how the file was saved and on Windows or organizational backup settings. Excel’s AutoRecover and document recovery features can help after certain interruptions, but they are not the same as undo and should not be treated as a guaranteed record of every edit. Saving regularly and keeping an appropriate backup are safer than depending on recovery features after an accidental deletion.

Windows, Mac, and Excel for the web

On Windows desktop Excel, the main undo shortcut is Ctrl+Z and the redo shortcut is Ctrl+Y. On Mac desktop Excel, use Command+Z for Undo and Command+Y for Redo. Mac keyboards label the Command key with the ⌘ symbol. If a shortcut behaves differently because the active control is a cell editor, formula bar, dialog, or another application element, first return focus to the worksheet and try again.

Excel for the web has Undo and Redo buttons in its interface and supports keyboard shortcuts, but the browser can affect how a key combination is handled. If Ctrl+Z does not produce the expected worksheet result, use the visible Undo button. Also remember that Excel for the web and desktop Excel do not necessarily expose every feature in exactly the same place. The core idea is unchanged: Undo reverses a recent action that Excel can undo in the open workbook.

Do not confuse the Undo button with the Save command. Saving writes the current workbook state to its storage location; it does not serve as a command to reverse the last edit. An edit may still be undoable after a save, but saving is not a reliable way to create a rollback point. For a deliberate checkpoint, keep a separate copy or use the file’s available version-history features.

Common undo problems and practical checks

If Ctrl+Z appears to do nothing, check the active window and the current editing mode first. A dialog box, another application, or text being edited inside a cell can change what receives the keystroke. Press Enter or Esc to leave cell editing, click a worksheet cell, and then try the shortcut or the visible Undo button.

If Undo reverses the wrong action, remember that Excel works backward from the most recent eligible action. It cannot skip a formatting change to undo an older deletion while preserving everything in between. Inspect the worksheet after each step. If the needed earlier state is not reachable without losing later work, consider copying the current file and using version history to recover the older content separately.

If the Undo control is disabled, there may be no undoable action in the current history, or the latest operation may not support Undo. A macro is a common reason the ordinary history is no longer available. Avoid immediately repeating an operation that might make the situation worse; first check whether the data remains elsewhere in the workbook, in another saved version, or in a backup.

Before a risky bulk operation, reduce the chance that Undo will be your only safety net:

  • Save a separate copy before running a macro or making a large structural change.
  • Check the selected range before deleting, clearing, sorting, or pasting data.
  • After a large change, review the result promptly and undo immediately if it is wrong.
  • For important shared or stored files, know where version history or backups can be accessed.

Frequently Asked Questions

What is the shortcut key for Undo in Excel?

Press Ctrl+Z in Excel for Windows. On a Mac, press Command+Z. The shortcut reverses the most recent action Excel can undo, and pressing it again can move farther back through the available undo history.

What is the redo shortcut in Excel?

In Windows Excel, press Ctrl+Y to redo an action you just undid. In Mac Excel, press Command+Y. Redo is available only while Excel retains a redo path; making a new edit after undoing can replace that path.

Can I undo several actions at once?

Yes. Repeatedly press Ctrl+Z on Windows or Command+Z on Mac to reverse successive eligible actions. In desktop Excel, the Undo history arrow may also show a list that lets you step back across multiple recent actions.

Why does Ctrl+Z not undo my Excel change?

The action may not be undoable, the undo history may have been cleared, or focus may be in another window or inside cell editing. Try clicking a worksheet cell and using the Undo button. If the change came from a macro, Excel’s normal Ctrl+Z history generally cannot reverse it.

Can I undo a change after closing the workbook?

Usually, you cannot use the prior session’s Ctrl+Z sequence after closing and reopening a workbook. Look for version history if the file is stored in OneDrive or SharePoint, or use a backup or recovery copy for a locally stored file.

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.