Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Clear a Sort in Excel and Restore Original Order

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Excel has no single "clear sort" button. To get your original row order back, undo the sort immediately with Ctrl+Z (Cmd+Z on Mac), or use Data > Sort with one of your existing numbered columns as the sort key. If no undo is available and no helper column exists, add a temporary sequence column to a copy of the file before sorting in future — that column is what lets you reverse a sort at any point later. For a custom sort or a filtered view, "clearing" means removing the custom order or the filter itself, which is a slightly different operation covered below.

What You'll Need

  • Excel on Windows, Mac, or Excel for the web (labels vary slightly by version and platform; the steps below note where).
  • A worksheet where the sort you want to remove has already been applied.
  • Ideally: an undo history that hasn't been overwritten, or a numbered column you can sort by.
  • A backup copy of the file if you are about to try anything that reorders rows and you are unsure of the result. Save a copy with File > Save As before you experiment.

Step-by-Step

  1. Notice what kind of sort you have. Look at whether the rows are rearranged alphabetically, numerically, by date, or by a custom list (Monday, Tuesday, Wednesday…). Also check whether a filter is active — a small funnel or dropdown arrow icon in the header row means filtering, not sorting, and that has to be removed separately. This determines which fix below applies.
  2. If you just sorted, press Ctrl+Z once. On Mac, press Cmd+Z. A single undo reverses the whole sort in one keystroke. Press it again only if you also changed cell values in the same session — each press undoes one action, so you may step back past a cell edit before reaching the sort.
  3. Check for a saved version if undo is gone. If the file was saved and closed after sorting, the undo stack is cleared. Open File > Info > Version History (or the version list shown for files stored in OneDrive or SharePoint) and open the version from before the sort. Save a copy of it before overwriting anything. Excel for the web and Excel desktop both surface version history for cloud-stored files; locally saved files that were never uploaded may have no history at all.
  4. Reverse the sort using an existing ID or number column. If your table has a row number, invoice number, employee ID, or timestamp that was entered in order, click any cell in the data, go to the Data tab, click Sort, set Sort by to that column, and set Order to Smallest to Largest. This usually restores the original layout because those values were assigned in sequence.
  5. Reverse with a helper column if one exists. Many people keep a hidden or far-right column holding 1, 2, 3, 4… Use the same Data > Sort dialog and sort ascending on that column, then delete or hide the helper column if you no longer need it.
  6. Remove a custom sort order. If the data is sorted by a custom list such as weekdays or months, opening Data > Sort and choosing the custom list again will re-sort into that order, not undo it. There is no command that resets a custom sort; you must sort by another column (an ID column, or a helper column) to return to the previous order, or undo the sort.
  7. Remove a filter. If a funnel icon appears in the header, go to Data and click Filter (or the Clear button inside the filter dropdown menu) to remove the filter and show all rows. Clearing a filter does not change row order — it only reveals the hidden rows in the positions they currently occupy. Combine this with one of the steps above if the order is also scrambled.
  8. Re-sort by the column you actually want last. Sometimes the goal is not the original order but a sensible one — sort by date ascending, or by customer name A–Z. In that case click any cell in the data, go to Data > Sort, choose the column and direction, and confirm. Always check that the whole table is selected so rows stay intact.
  9. Save the result under a new name if you are unsure. Use File > Save As (or File > Save a Copy) so you keep the previous version available in case the restore was wrong.

Common Mistakes

  • Sorting a single column. If you click one cell and press the A–Z button while Excel fails to detect a table, it can sort only that column and leave every other column untouched, which rips rows apart. Always select the whole range or a single cell inside a properly formatted table, and watch for the Sort Warning dialog — choose Expand the selection when it appears.
  • Expecting undo to survive a save and reopen. Undo history is per session. Once the file is closed, Ctrl+Z cannot reverse a sort.
  • Confusing filter with sort. Clearing a filter does not put rows back in their original order. If rows appear out of order after clearing a filter, a sort was applied too.
  • Sorting blank rows or subtotals into the middle. Blank rows inside a range get sorted to the bottom (or top) and can separate your data. Delete blank rows before sorting.
  • Forgetting merged cells. Merged cells cannot be sorted reliably and produce errors. Unmerge them first (Home > Merge & Center).
  • Trusting an approximate date column. Sorting by a date or text field with mixed formats can produce a near-order that is not the original. Verify a few rows against the previous version.

Tips

  • Add a permanent row-number column (fill 1, 2, 3 and drag down) before any sorting. It costs one column and makes every future sort reversible.
  • Format the range as a table with Ctrl+T (Cmd+T on Mac). Tables keep rows together when sorting and make the data range unambiguous.
  • Use Data > Sort rather than the A–Z toolbar buttons when you need control over which column is the sort key and whether it is ascending or descending.
  • Store files in OneDrive or SharePoint if you want version history — it is the most reliable way to recover the pre-sort state when undo is no longer available.
  • Before a large sort, copy the sheet (right-click the sheet tab, then Move or Copy, and tick Create a copy). The duplicate is a one-click restore point.
  • If you sorted by a custom list accidentally, note the list name; the Sort dialog shows which list is applied, which helps you avoid repeating it.

Troubleshooting

  • Ctrl+Z does nothing or undoes the wrong thing. The undo stack may have been consumed by later edits or cleared by saving and reopening. Use Version History instead.
  • Sort Warning keeps appearing. Excel is unsure whether to expand the selection. Choose Expand the selection to keep rows whole. If the warning does not appear at all, your range may contain a blank column that splits the table — remove the blank column and try again.
  • Rows are scrambled after sorting one column. This usually cannot be fully undone if the original values are gone. Restore from Version History or a backup. If neither exists, check whether each row has a unique identifier you can use to manually reconcile the original order.
  • The sort puts 10 before 2. The column contains text, not numbers. Select the column, go to Data > Text to Columns, or convert the values to numbers, then re-sort.
  • Dates sort incorrectly. Excel may be reading some entries as text. Use Data > Text to Columns with the Date format for that column, then sort again.
  • Sort options are greyed out. The sheet may be protected or the cells locked in a shared workbook. Go to Review > Unprotect Sheet (a password is required if one was set).
  • Version history is empty. Only files saved to OneDrive, SharePoint, or a compatible cloud service keep version history; local files generally do not. In that case a saved copy is your only restore route.

Frequently Asked Questions

Is there a one-click way to remove a sort in Excel?

No. Excel does not store a "previous order" state for you. Undo (Ctrl+Z) is the only one-step reversal, and it works only immediately after the sort in the same session.

Does clearing a filter restore my original row order?

No. A filter hides rows but leaves them in their current positions. If the data looks out of order after clearing a filter, a sort was also applied and must be reversed separately.

Can I undo a sort after saving and closing the file?

Not with undo. If the file is stored in OneDrive or SharePoint, open File > Info > Version History and restore the version from before the sort. Local files usually have no such history.

Will sorting a custom list back to A–Z remove it?

It changes the display order but does not delete the custom list from Excel's saved lists. The list remains available to apply again.

Why did only one column get sorted?

Excel treated that column as a separate range, often because of a blank column or because the range was not contiguous. Select the whole table, or format it as a table, then sort again and choose Expand the selection if prompted.

How do I stop this happening again?

Add a numbered helper column and format your data as a table with Ctrl+T. That way any sort can be reversed by sorting on the number column, and rows stay intact during sorting.