Clear Sort from Excel: How to Reset Data Order
In this article
To clear a sort in Excel, you must either use the Undo command immediately after sorting or have a dedicated index column created before the sort was applied. Because Excel does not have a single "Clear Sort" button that remembers the previous state of your data once the file is saved or the session is closed, the only way to return to the original sequence is to sort by a column that contains the original row numbers.
What You'll Need
- A Microsoft Excel workbook containing the data you wish to reorganize.
- An index or ID column (if you are attempting to revert a sort from a previous session).
- Administrative permissions to edit the spreadsheet.
Step-by-Step
Depending on whether you just performed the sort or if you are opening a file that was sorted long ago, choose the appropriate method below. Note that menu labels may differ slightly based on your version of Excel (Office 365, Excel 2021, or Excel for Web) or your operating system.
Method 1: Using the Undo Command (Immediate Reversal)
- Immediately after applying a sort, look at the top left of the Excel window in the Quick Access Toolbar.
- Click the Undo arrow icon.
- Alternatively, press Ctrl + Z on Windows or Command + Z on macOS.
- Continue pressing Undo until the data returns to its original arrangement. This is only possible if the sort was the most recent action performed and the workbook has not been closed.
Method 2: Using an Index Column (The Professional Method)
Since Excel treats a sort as a permanent change to the row order, the only foolproof way to "clear" it later is to have a reference point. If you have an index column, follow these steps:
- Locate the column that contains the original row numbers (often labeled "ID", "No.", or "Index").
- Click any cell within that index column to select it.
- Navigate to the Data tab on the top ribbon.
- In the Sort & Filter group, click the Sort A to Z (Smallest to Largest) button.
- Excel will reorganize the entire dataset based on those original numbers, effectively clearing any alphabetical or numerical sorts applied to other columns.
Method 3: Creating an Index Column for Future Use
If you currently have unsorted data and want to ensure you can clear any future sorts, set up a safety net now:
- Insert a new column at the far left of your data range. Right-click column A and select Insert.
- Label the header of this column as "Original Order" or "Index".
- In the first data cell (A2), type the number
1. - In the second data cell (A3), type the number
2. - Select both cells (A2 and A3).
- Hover your mouse over the bottom-right corner of the selection until the cursor turns into a small black cross (the Fill Handle).
- Double-click the Fill Handle or drag it down to the bottom of your dataset. Excel will automatically sequence the numbers.
- Now, no matter how many times you sort by name, date, or value, you can always sort this column from Smallest to Largest to return to this exact starting point.
Common Mistakes
One of the most frequent errors users make is sorting a single column without expanding the selection. If you select only one column and click sort, Excel will ask if you want to "Expand the selection." If you choose "Continue with the current selection," Excel will sort only that column, effectively scrambling your data. The rows will no longer match, and the original order is permanently lost because the relationship between the data points in the same row has been broken. Always ensure the entire table is selected or that you allow Excel to expand the selection.
Another common mistake is relying on the Undo button after saving the file. Once you save a workbook and close it, the Undo history is wiped clean. Many users assume that because they can undo a formula, they can undo a sort from yesterday. This is not possible. Without an index column, there is no metadata stored within the cells that remembers "Row 5 used to be Row 12."
Lastly, users often confuse "Filtering" with "Sorting." Filtering hides rows that don't meet criteria, while sorting moves the rows. Clearing a filter is easy (Data > Clear), but clearing a sort requires the methods listed above.
Tips
To avoid the stress of losing your original data order, get into the habit of converting your data range into an official Excel Table. Select your data and press Ctrl + T. Tables make sorting and filtering more intuitive and reduce the risk of accidentally sorting only one column instead of the whole set.
If you are working with massive datasets where manual numbering is tedious, you can use the =ROW() function. In your index column, type =ROW()-1 (assuming you have one header row). This formula dynamically assigns a number based on the row's position. However, be careful: if you sort the data while the formula is active, the numbers will change to match the new positions. To lock them in, copy the column and use Paste Special > Values to convert the formulas into static numbers before you begin sorting.
Consider keeping a "Master Copy" of your raw data on a separate worksheet. Before applying complex sorts or data cleaning, right-click the sheet tab at the bottom and select Move or Copy..., check Create a copy, and rename it "Backup." This provides a fail-safe way to recover the original order without needing an index column.
Troubleshooting
If you try to sort by your index column but the data doesn't return to the original order, check for merged cells. Merged cells often interfere with sorting operations. Excel may prevent you from sorting if the selected range contains merged cells of different sizes. Unmerge the cells using the Home > Merge & Center toggle and try the sort again.
If the sort seems to be ignoring some rows, check for blank rows in your dataset. Excel often perceives a completely blank row as the end of the data range. If there is a blank row at line 50, sorting the table may only affect lines 1 through 49. To fix this, manually select the entire range of your data (including the blank rows) before clicking the sort button.
If you find that your index numbers are not sorting correctly (e.g., 1, 10, 11, 2, 20), your numbers are likely formatted as text. This is called "alphabetical sorting" of numbers. To fix this, select the column, go to the Data tab, select Text to Columns, and simply click Finish. This forces Excel to re-evaluate the cells as numbers, allowing a proper numerical sort.
Frequently Asked Questions
Is there a "Reset Sort" button in Excel?
No, Excel does not have a built-in button to reset a sort to its original state. You must use Undo (immediately) or an index column (long-term).
Can I clear a sort if I already saved and closed the file?
Only if you created an index column before sorting. If you did not, and the file has been saved and closed, the original order cannot be recovered unless you have a backup copy of the file.
Does clearing a filter also clear a sort?
No. Filtering and sorting are different functions. Clearing a filter reveals hidden rows, but it does not change the order of the rows that were sorted.
What is the fastest way to create an index column for 10,000 rows?
Type 1 in the first cell, 2 in the second, select both, and double-click the small green square (Fill Handle) in the bottom-right corner of the selection. Excel will fill the sequence to the bottom of your data instantly.
Will sorting by an index column delete my other sorted data?
No. Sorting simply rearranges the rows. It does not delete any data, provided you have selected the entire table so that the information in each row stays together.