How to Undo in Excel: Step-by-Step Guide
In this article
To undo in Excel, press Ctrl+Z on Windows or Command+Z on Mac. That single shortcut reverses your most recent action, whether you typed a value, deleted a row, applied formatting, or moved a cell. If you need to go back several steps, press the shortcut repeatedly. Excel keeps a history of your recent actions, and each press walks backward through that list. This guide covers the exact steps, the limits of undo in Excel, and what to do when Ctrl+Z does not behave as expected.
What You'll Need
- Microsoft Excel for Windows, Mac, or the web (the shortcut and behavior are nearly identical across versions; labels may differ slightly by version, device, or region).
- A keyboard with a working Ctrl key (Windows) or Command key (Mac).
- An open workbook where you have made at least one change. Undo only works on actions performed since the file was last saved or opened, and only within the current session.
Step-by-Step
- Identify the action you want to reverse. Undo works in reverse chronological order, so the first press reverses the most recent change. If you just typed over a formula, that is what will come back first.
- Press Ctrl+Z (Windows) or Command+Z (Mac). The last action is reversed immediately. There is no confirmation dialog for most actions.
- Press the shortcut again to undo earlier actions. Each press moves one step further back in the history. You can also click the Undo button (the curved arrow pointing left) on the Quick Access Toolbar at the top of the window. Clicking the small arrow next to that button shows a dropdown list of recent actions; selecting an entry undoes that action and everything after it.
- Watch the screen for context. If you undo a deletion, the row or column reappears. If you undo a formatting change, the cell returns to its previous style. If nothing visible changes, the undone action may have been something subtle, such as a column width adjustment or a selection change.
- Stop when you reach the state you want. Do not keep pressing out of habit. Once you pass the point you wanted, you need Redo to move forward again.
- Use Redo if you went too far. Press Ctrl+Y (Windows) or Command+Y (Mac), or click the Redo button on the Quick Access Toolbar. Redo only works for actions you just undid and is cleared as soon as you make a new edit.
- Save the file once you are satisfied. Press Ctrl+S (Windows) or Command+S (Mac). Saving does not clear the undo history during the same session, but closing the workbook does.
Common Mistakes
- Expecting undo to survive a close. Undo history is tied to the current editing session. If you close the workbook without saving, Excel may offer to recover unsaved changes, but the undo stack itself is gone. If you save and close, the saved version becomes the new baseline.
- Assuming undo works after certain actions. Some actions clear the undo history or cannot be undone. These include running a macro that modifies the workbook, some operations that change the file structure, and actions taken after a co-author edits the same file in a shared workbook. In those cases Ctrl+Z may do nothing or may skip past the action.
- Confusing undo with reverting a save. Ctrl+Z does not restore a previously saved version of the file. To go back to an earlier saved state, use File > Info > Version History if the file is stored on OneDrive or SharePoint, or restore from a backup. Version History availability depends on where the file is saved.
- Pressing undo inside a cell edit. If you are actively typing in a cell and press Ctrl+Z, Excel may undo the text you just typed within the cell rather than the previous workbook action. Press Enter or Esc first to commit or cancel the edit, then use undo.
- Relying on undo for deleted sheets. Deleting a worksheet can be undone with Ctrl+Z in the same session, but if you save and close, the sheet is gone. Right-click the sheet tab and choose Delete carefully, and keep a backup of important workbooks.
Tips
- Use the dropdown for multi-step undo. The arrow beside the Undo button lists recent actions by name. Hovering over an entry previews what will be undone, which is safer than pressing Ctrl+Z blindly many times.
- Undo is per workbook window. If you have two workbooks open, undo applies to the active window. Click the window you want to fix before pressing the shortcut.
- Redo is your safety net. If you undo too far, Ctrl+Y steps forward again. The Redo stack is cleared once you make a new edit, so decide quickly.
- Save before risky operations. Before deleting rows, running a macro, or applying a large formatting change, press Ctrl+S. If undo fails, you can close without saving and reopen the last saved version.
- Keyboard layout matters. On some non-US keyboards, the Z key is in a different position. The shortcut is still Ctrl+Z by letter, not by position.
Troubleshooting
If Ctrl+Z does nothing, first click inside the worksheet grid to make sure Excel has focus; the shortcut will not work while a dialog box is open or while you are editing text inside a cell. Press Esc to exit any edit mode, then try again. If the shortcut still fails, check whether the workbook is shared or protected: in a shared workbook, some undo behavior is limited, and in a protected sheet, changes to locked cells are blocked rather than undoable. Try the Undo button on the Quick Access Toolbar to see whether the command is available at all; if the button is greyed out, there is nothing in the undo history.
If undo reverses the wrong thing, you may have pressed it while a cell was in edit mode. Press Esc, then use the dropdown arrow next to the Undo button to pick the specific action you want to reverse. If you have undone too far, press Ctrl+Y to redo. If Redo is unavailable, you made a new edit after undoing, which cleared the redo stack; in that case, close the workbook without saving and reopen it to return to the last saved state, accepting that any unsaved work since then is lost.
If Excel crashes or closes unexpectedly, reopen the file. Excel may offer a recovered version. The undo history from the previous session is not restored, so compare the recovered file with your last save before continuing.
Frequently Asked Questions
How many times can I undo in Excel?
Excel keeps a limited history of recent actions, and the exact number varies by version and by the type of actions performed. In practice you can undo many steps in a row, but very old actions eventually drop off the list. If you need to go back further than the history allows, use Version History or a backup.
Does undo work after I save the file?
Yes, within the same session. Saving does not clear the undo history, so you can still press Ctrl+Z after saving. Closing the workbook ends the session and clears the history.
Can I undo a deleted worksheet?
Yes, if you have not closed the workbook. Press Ctrl+Z immediately after deleting the sheet. If you save and close first, the deletion becomes permanent unless you restore an earlier version from Version History or a backup.
Why is Ctrl+Z not working on my Mac?
On Mac, the shortcut is Command+Z, not Ctrl+Z. If Command+Z still does nothing, click the worksheet grid to ensure Excel has focus, press Esc to leave any cell edit, and try the Undo button on the toolbar.
What is the difference between undo and redo?
Undo reverses your last action; redo reapplies an action you just undid. Redo is Ctrl+Y on Windows and Command+Y on Mac, and it is only available until you make a new edit.
Does undo work in Excel for the web?
Yes, the browser version supports undo with Ctrl+Z (Windows) or Command+Z (Mac), and the toolbar includes Undo and Redo buttons. Behavior for co-authored files can differ, and some actions may not be undoable.