How to Undo a Sort in Excel & Google Sheets
Written by
Reviewed by
This tutorial demonstrates how to undo a sort in Excel and Google Sheets.
Undo a Sort With the Undo Command
Say you have the dataset below, sorted by Month (Column D) first and by Product (C) second.
If you now sort it by SKU (Column B) and want to undo that sort, the easiest way is to use the Undo button in the quick access toolbar (or use the keyboard shortcut CTRL + Z).
As a result, records are again sorted by month and product. However, this option has constraints, as you can use it just after the sort. If you save or close the file, there is no option to use the undo button to undo the sort.
Undo a Sort Using Index Column
The alternative way to enable to undo a sort in every moment is to initially add one column at the beginning of the data set and use it as a unique index for every row.
- Right-click on the Column B heading, then left-click Insert.
- Enter a unique number for each row (e.g., 1, 2, 3, etc.).
- Now sort data by SKU (Column C).
- To undo a sort, just sort data again by Index (Column B). Click anywhere in the index column (B2:B17), and in the Ribbon, go to Home > Sort & Filter > Sort Smallest to Largest.
Finally, data is again sorted as initially (by month). Using this method, you can undo a sort at any time.
NOTE: VBA code can also be used to undo a sort in Excel.
Undo a Sort in Google Sheets
You can use either of the methods above to undo a sort in Google Sheets.