In Excel for Microsoft 365 on Windows, press Ctrl+Z to undo your most recent action. On a Mac, press Command+Z. You can repeat the shortcut to step backward through recent changes, as long as Excel still has those actions in its undo history.
The Excel Undo shortcut
Ctrl+Z is the quickest way to reverse an accidental edit, deletion, formatting change, or many other spreadsheet actions. Each press normally undoes one action, so if you entered a value and then applied bold formatting, the first press may remove the formatting and the next may undo the entry. The sequence depends on what you did and how Excel grouped the actions.
To use the shortcut:
- Make sure the workbook window is active and you are not typing into a cell or the formula bar.
- Press Ctrl+Z on Windows, or Command+Z on Mac.
- Check the worksheet to confirm that Excel reversed the intended change. Press the shortcut again only if you want to go back another step.
Undo is not limited to changes in the active cell. It can reverse many worksheet operations, including typing, deleting content, changing formats, inserting rows, and pasting. Whether a particular command can be undone depends on the operation and the state of the workbook.
Undo from Excel’s toolbar
If you prefer not to use a keyboard shortcut, select Undo on the Quick Access Toolbar near the top-left of the Excel window. In some layouts, the toolbar may be above or below the ribbon, or its commands may be customized. The Undo button’s arrow can open a list of recent actions; selecting an earlier action in that list can undo that action and the later actions above it in the sequence.
Use the toolbar when you are working on a device without a convenient keyboard, or when you want to see the action description before undoing it. The label may identify the last action, such as typing or formatting. Treat the list as a sequence, not as a collection of independent changes: choosing an older step also reverses intervening steps.
How Excel’s undo and redo history works
Excel keeps a temporary sequence of recent actions so you can move backward and, in many cases, forward again. Undo moves backward through that sequence. Redo restores an action that you just undid, provided you have not replaced the redo path with a new edit.
On Windows, press Ctrl+Y to redo an undone action. On Mac, use Command+Y. Redo is also available from Excel’s toolbar. For example, if you change a cell’s fill color and then press Ctrl+Z, pressing Ctrl+Y can apply that fill color again.
After undoing several actions, making a different change generally discards the forward steps that could have been redone. Imagine you type a value, format it, and then undo both actions. If you now enter a different value, Excel treats that as a new branch of work; you should not expect Redo to restore the old value and formatting. This is why it is useful to check the sheet before making a new edit if you may want to redo something.
What Undo can reverse
Undo can help with routine mistakes throughout a workbook, but it is not a universal rollback for everything that happens around Excel. Many ordinary worksheet edits are reversible. For example, if you replace a quantity in a cell by mistake, Ctrl+Z can restore the previous entry. If you paste over a range, Undo may restore the cells that were there before the paste. If you apply a number format to the wrong selection, Undo can often remove that formatting change.
Some actions are grouped together, so one Undo may reverse more than one small keystroke. Conversely, one task may take several Undo presses if Excel recorded its steps separately. The action descriptions in the toolbar’s Undo list are helpful when the result is not obvious.
- Cell content: Undo a recent entry, deletion, or replacement when the action remains in the history.
- Formatting: Reverse many recent changes to font, fill, number format, or similar cell appearance.
- Worksheet operations: Undo many inserted or deleted rows and columns, depending on the operation and subsequent actions.
- Paste actions: Reverse many pastes, including changes to multiple cells, while the relevant action is still available.
Do not assume that Undo will reverse something performed outside the workbook, such as a file operation in Windows or a message sent from another application. It reverses supported Excel actions, not every event that might affect your work.
Why Undo may be unavailable
If Undo is dimmed, or Ctrl+Z does not produce the result you expect, first check whether Excel is currently editing a cell. When the insertion point is inside a cell or the formula bar, the shortcut may act on the text being edited rather than on the previous worksheet command. Press Enter to finish the edit or Esc to cancel it, then try Undo again if appropriate.
Another possibility is that the action cannot be undone, or that Excel no longer has it in the current undo history. Running a VBA macro clears Excel’s undo history, so you generally cannot use Ctrl+Z to reverse what the macro did or recover earlier undo steps afterward. Some other commands and connections can also affect what actions remain available. If you are unsure, save a separate copy before experimenting with a consequential operation.
Undo history is temporary and tied to the open editing session; it is not a permanent record of every workbook change. Closing and reopening a workbook does not give you a way to press Ctrl+Z for edits from the previous session. Saving while the workbook remains open is different: saving alone should not be treated as a substitute for closing, and it does not turn Undo into a permanent history feature.
When Undo is not enough: recover an earlier version
If the needed action has fallen out of the undo history, look for a saved earlier version rather than repeatedly pressing Undo. For a workbook stored in OneDrive or SharePoint, Microsoft 365 version history may let you open or restore an earlier saved version. In Excel for Windows, look for File > Info > Version History; the exact entry point can vary with the account, storage location, or interface. Review the date and contents carefully before restoring a version, because restoration can replace the current state.
A cautious recovery process is:
- Save a copy of the current workbook under a different name, if possible.
- Open Version History for the cloud-stored file and identify a version from before the unwanted change.
- Open or restore that version, then compare the relevant sheets and cells with the current copy.
- Keep the copy that contains the information you need, rather than assuming that the oldest version is automatically the right one.
Version history is not the same as Undo. It depends on the workbook being stored in a location and account that provide versioning, and its available snapshots may not include every individual edit. AutoSave also helps save ongoing work in supported cloud locations, but it does not guarantee that every mistake can be reversed. For important workbooks, keeping sensible backup copies is a useful complement to Undo.
Windows, Mac, and Excel for the web
The main shortcut differs by keyboard: use Ctrl+Z on Windows and Command+Z on Mac. Redo is Ctrl+Y on Windows and Command+Y on Mac. Excel for the web also provides Undo and Redo controls in its interface, and keyboard behavior can depend on the browser and operating system. If a shortcut is intercepted or behaves unexpectedly in the browser, use the Undo control in Excel itself.
The toolbar’s placement can look different across desktop and web versions, and a customized Quick Access Toolbar may not show the Undo button. The principle remains the same: Undo reverses a recent supported change in the current editing history. If you are following instructions written for another platform, check the displayed shortcut or use the visible control instead of assuming every key combination is identical.
Frequently Asked Questions
What is the Undo shortcut in Excel?
Press Ctrl+Z in Excel for Windows. On a Mac, press Command+Z. The shortcut reverses the latest supported action, and you can press it again to undo earlier actions in sequence.
How do I undo several actions at once?
Press Ctrl+Z repeatedly on Windows or Command+Z repeatedly on Mac. You can also open the arrow next to Undo on the Quick Access Toolbar and choose an earlier point; Excel will undo that action and the later actions in the list.
What is the shortcut to redo in Excel?
Use Ctrl+Y on Windows or Command+Y on Mac to redo an action you just undid. If you make a new edit after undoing, the earlier redo sequence may no longer be available.
Can I undo after saving an Excel file?
Usually, you can still undo recent supported actions after saving as long as the workbook remains open and the actions remain in its undo history. Saving is not a permanent edit log, and closing then reopening the file does not restore the old session’s Undo steps.
Why does Ctrl+Z not work in Excel?
The workbook may not be active, Excel may be in cell-edit mode, or the action may not be undoable or may have cleared the undo history. Try finishing or canceling the cell edit, check the Undo button, and consider Version History or a backup if the change is no longer in the current history.
Related
- Quick Search in Excel: Find Data Fast
- Capitalize First Letter in Excel Quickly
- Superscript in Excel: Quick Key and Formatting Steps
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Cell Dropdown: Create a Pick List and Use ItTo create a dropdown pick list in Excel for Microsoft 365 on Windows, select the cell or cells,…
- Insert Rows in Excel Multiple Times: A Step-by-Step GuideTo insert several rows in Excel at once, select the same number of row headers as the number…
- Excel Payment Request: Create, Track, and Send OneAn Excel payment request is a spreadsheet you use to tell a customer or client what they owe,…
- How to Turn On Circular Reference Iteration in ExcelIn Excel for Microsoft 365 on Windows, turn on circular-reference calculation by going to File > Options >…
- Excel Power Query: Delete Duplicate RowsTo delete duplicates with Power Query in Excel for Microsoft 365 on Windows, open the query, select the…
- Google Sheets: Get a List of Unique ValuesWith source values in A2:A, enter =UNIQUE(A2:A) in an empty cell to return each distinct value once. This…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.