Undo in Excel: Keyboard Shortcut and How to Use It

How-to basics · Updated November 20, 2026

To undo your last action in Excel for Microsoft 365 on Windows, press Ctrl+Z. Press it again to undo the action before that. On a Mac, use Command+Z. Undo reverses many recent changes to a workbook, such as typing, formatting, or deleting cell contents, as long as Excel still has those actions in its undo history.

What You’ll Need

  • Excel open with the workbook you want to change.
  • A keyboard, or access to Excel’s Undo button if you are using a touch device or prefer the ribbon and toolbar.

No special setting or add-in is needed. The shortcut works in desktop Excel and Excel for the web, although browser or device shortcuts can sometimes affect what happens if focus is outside the worksheet.

Step-by-Step

  1. Check that Excel is the active app. Click inside the workbook if necessary. If you are typing in a cell, first consider whether you want to undo a change that has already been entered or cancel the text currently being edited. Pressing Enter or clicking another cell commits an edit; Esc cancels the current uncommitted edit. Once the change is committed, use Undo to reverse it.
  2. Press the correct shortcut. On a Windows keyboard, hold down Ctrl and tap Z once. You do not need to hold the keys down. On a Mac, hold Command and tap Z. Excel should immediately reverse the most recent undoable action and update the worksheet.
  3. Check the result before continuing. Look at the affected cell or range to confirm that the intended change was reversed. For example, if you just replaced a value in B4, one Undo should restore the previous value in B4. If the result is not what you expected, pause rather than making more changes; you can often redo an accidental undo.
  4. Undo more than one action, if needed. Press Ctrl+Z again on Windows, or Command+Z again on Mac, once for each earlier action you want to reverse. Excel works backward through the available history. For instance, if you entered a value, applied a fill color, and then changed the font, three presses can reverse those changes in reverse order, provided each one is undoable and no other action has intervened.
  5. Use the Undo button to review a sequence. In desktop Excel for Windows, find the Undo button on the Quick Access Toolbar near the top of the window. Select its small drop-down arrow to view recent actions, then choose the last action you want to undo. Excel also reverses the actions listed above it, so choosing an earlier item can undo several changes at once. The button’s location can vary if the toolbar has been customized. On Mac, use the Undo control in the toolbar or the Edit menu if you prefer not to use the keyboard.
  6. Redo if you undo too far. If you reverse an action by mistake, use Ctrl+Y on Windows to redo it. In Excel for Mac, use Command+Y where available, or choose Redo from the Edit menu. Redo reapplies an action that was just undone. If you make a new change after undoing, Excel may discard the previous redo sequence, so use Redo before continuing with other edits.
  7. Use the Undo control in Excel for the web when needed. Ctrl+Z generally works in Excel for the web on Windows, and Command+Z is the Mac equivalent. You can also select the Undo button in the Excel window. If the shortcut affects the browser instead, click a worksheet cell to return focus to Excel and try again. The web app’s available undo history can differ from desktop Excel, so verify the result after each press.

Undo is sequential: Excel reverses actions in the order they were performed, not in the order you select cells or think about the changes. If the wrong item changes, check the undo history and the recent actions rather than repeating the shortcut rapidly. A workbook shared with other people may also receive updates while you are working, so check the current cell contents before undoing changes in a collaborative file.

Common Mistakes

  • Using the wrong key combination. Windows uses Ctrl+Z; Mac uses Command+Z. The Ctrl key on a Mac is not the usual substitute for Command in Excel’s undo shortcut.
  • Pressing Undo before an edit is committed. If a cell is still being edited, use Esc to cancel that in-progress edit. Undo is intended to reverse a completed action, and the two operations are not interchangeable.
  • Undoing too many actions. Each press goes one step farther back. Repeated presses can remove changes you wanted to keep, so check the worksheet after each press or use the drop-down list to inspect the sequence.
  • Expecting Undo to restore every kind of change. Some Excel operations cannot be undone, and running a VBA macro clears the undo history. If Undo is unavailable or an operation is not supported, the shortcut cannot recreate a previous state.
  • Confusing Undo with deleting or clearing. Undo reverses an earlier action; it does not automatically clear the selected cell. If you want to remove cell contents, select the cell and use Delete, then use Undo if you need to restore what was removed.

Tips

  • Undo immediately after spotting a mistake. The sooner you act, the easier it is to identify the relevant entry in the undo sequence. If you continue editing, you add more steps that may need to be reversed first.
  • Use the drop-down list for a specific stopping point. The Undo arrow’s list helps when several actions need reversing. Read the labels, choose the last action you want to remove, and remember that all later actions in the list will be undone too.
  • Save a copy before a risky batch of work. Undo is convenient, but it is not a substitute for a backup. Before a large import, extensive restructuring, or other work you may need to recover, save a separate copy with a clear filename.
  • Remember that Undo is not the same as restoring a saved version. Undo covers actions in the current undo history. If a change is no longer undoable, check whether the workbook is stored in OneDrive or SharePoint and whether version history is available. Version history can let you open an earlier saved version, but review it carefully before replacing current work.
  • Watch for focus changes. If you have clicked a formula bar, dialog box, or browser control, the shortcut may act on that control rather than the worksheet. Click back into a cell when you want Excel to receive the command.

Troubleshooting

Nothing happens when you press the shortcut. Confirm that the workbook is active and that you are using the right key for your computer. If a dialog box is open, close it or return to the worksheet first. You can also select the Undo button. If the button is dimmed or unavailable, there may be no undoable action in the current history.

The wrong change is reversed. Excel undoes the most recent eligible action, which may not be the cell you were focused on when you pressed the keys. Use the Undo drop-down to inspect recent actions, or redo the change with Ctrl+Y on Windows or the Mac Redo command, then decide what to reverse. Avoid pressing Undo repeatedly until you have checked the sequence.

You cannot undo a macro or a particular operation. Running VBA clears Excel’s undo history, and some operations are not included in that history. If a macro or non-undoable command changed the workbook, try closing without saving only if you are certain that doing so will not discard other needed work. Otherwise, check for a saved copy or an available OneDrive or SharePoint version. Do not assume that closing and reopening will preserve unsaved changes.

The shortcut works in the browser instead of Excel for the web. Click a cell in the worksheet to put focus back on the workbook, then try Ctrl+Z on Windows or Command+Z on Mac. If browser settings or another app continues to intercept the shortcut, use the Undo button inside Excel instead.

Undo appears to change more than one thing. The Undo list can group some related actions, and selecting an earlier entry reverses that entry and all later ones. Review the labels and inspect the worksheet after undoing. If the change was not right, use Redo before making new edits.

Frequently Asked Questions

What is the Undo keyboard shortcut in Excel?
In Excel for Microsoft 365 on Windows, press Ctrl+Z. On a Mac, press Command+Z.

Can I press Ctrl+Z several times?
Yes. Each press generally reverses one more recent undoable action. Check the result as you go, because several presses can remove changes you meant to keep.

How do I undo multiple actions at once?
Select the drop-down arrow beside Undo on the Quick Access Toolbar in desktop Excel for Windows, then choose an earlier action. Excel also reverses the later actions in that sequence. You can also press the shortcut repeatedly.

How do I reverse an Undo?
Use Redo: press Ctrl+Y in Windows Excel. On Mac, use Command+Y if available, or choose Redo from the Edit menu. Redo is most reliable before you make another change.

Why is Undo greyed out or unavailable?
There may be no undoable action, or the most recent operation may not support Undo. Running a macro clears the undo history. Use a backup or a suitable saved version if the change cannot be reversed from the current session.

Does Undo work in Excel for the web?
Yes, the Undo button and the platform’s usual shortcut generally work. If a browser shortcut takes over, click a worksheet cell and try again, or use the Undo button in Excel.

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.