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

· 5 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

Clearing a sort in Excel means removing the current sort order so your data returns to its original sequence. The fastest reliable method is the Sort button's Clear All option, but note that this only deletes the saved sort definition; it does not undo the sort itself. To actually restore the original row order, use Undo (Ctrl+Z) if the sort was recent, or re-sort by a column that records the original order, such as a numbered index column. This guide covers both the Windows and Mac desktop versions of Excel; the exact button labels can differ slightly between versions.

What You'll Need

  • A spreadsheet in Excel (desktop version for Windows or Mac)
  • Your data formatted as a range or an Excel Table (recommended but not required)
  • Optionally, a spare column you can use to number your rows before sorting, so the original order can always be restored

Step-by-Step

  1. Remove the saved sort definition: click any cell inside your sorted data, then go to the Data tab and click Sort to open the Sort dialog box.
  2. In the Sort dialog, click Clear All, then click OK. This deletes the saved sort levels. The rows stay where they are, but Excel no longer treats the range as actively sorted, and the sort arrow on the column header (in a Table) disappears.
  3. To restore the original order after a recent sort: press Ctrl+Z (Windows) or Command+Z (Mac) immediately, or click the Undo arrow in the Quick Access Toolbar. This only works if the sort was one of your most recent actions and the file has not been closed and reopened since.
  4. To restore the original order when Undo is no longer available: if you added an index column before sorting (numbers 1, 2, 3 down the rows), click any cell in that column and go to Data > Sort A to Z (or open the Sort dialog and sort by that column, Smallest to Largest). Your rows snap back to their original sequence.
  5. If you did not add an index column and Undo is gone, you can sometimes recover the original order by reopening a previously saved version: close the file without saving the sort, or use File > Info > Version History if the workbook is stored in OneDrive or SharePoint to open an earlier copy.
  6. Optional but smart for the future: before sorting any important data, insert a column, label it something like "Order", fill it with sequential numbers, then sort. You can then always re-sort by that column to get back.

Common Mistakes

  • Assuming Clear All un-sorts the data. Clear All in the Sort dialog only removes the sort definition; it does not move any rows. Many users expect the data to revert and think the feature is broken.
  • Sorting without an index column. If the original order matters and you sort before recording it, that order can be unrecoverable once Undo expires.
  • Selecting only part of the data before sorting. If you select a single column and sort it while the surrounding data is excluded, you can scramble rows relative to each other. Always click a single cell inside the full range and let Excel auto-expand the selection, or select the entire range first.
  • Closing and reopening the file before undoing. Undo history does not survive closing a workbook, so a quick Ctrl+Z becomes impossible.
  • Ignoring the "Sort Warning" dialog. When Excel asks whether to expand the selection or continue with the current selection, choosing the wrong option misaligns your data.

Tips

  • Convert your data to an Excel Table (select the range, then Insert > Table) before sorting. Tables show a small arrow on sorted column headers, making it obvious which column drives the current sort.
  • To quickly remove a Table's sort, click the filter arrow on the sorted column header and choose Clear Sort (or Sort by Color > Clear Sort in some versions). Again, this clears the definition, not the row order.
  • Press Ctrl+Z repeatedly to step back through several actions, not just the most recent one, as long as the session is still open.
  • Get in the habit of saving a copy (File > Save a Copy) before running experimental sorts on important data.

Troubleshooting

  • Clear All is greyed out or missing: make sure a cell inside the sorted range is selected and you opened the dialog from Data > Sort. If the sheet is protected, unprotect it via Review > Unprotect Sheet (you may need the password).
  • Ctrl+Z does nothing: the sort is likely too old in the undo stack, or the file was saved, closed, and reopened since. Fall back to the index column or Version History methods described above.
  • Data reverted but formulas now show errors: if rows were scrambled by a partial sort, Undo first. If that fails, restore from Version History or your last backup.
  • Sort keeps coming back: another user may have applied it in a shared workbook, or a macro is running. Check for a sort applied in a Table's saved view and clear it again with Clear All.
  • Rows are permanently out of order with no backup: look for any column that reflects the original sequence, such as dates, ID numbers, or receipt numbers, and sort by that instead.

Frequently Asked Questions

Does Clear All in the Sort dialog restore my original data order?

No. Clear All only removes the saved sort levels so Excel no longer considers the range sorted. To restore the original order, use Undo, an index column, or a previous file version.

How do I undo a sort after saving and closing the file?

Undo will not work anymore. Sort by an index or ID column if one exists, or open an earlier version through File > Info > Version History if the file is saved to OneDrive or SharePoint.

How do I clear a sort in an Excel Table?

Click the filter arrow on the sorted column's header and choose Clear Sort, or use Data > Sort > Clear All. Both remove the sort definition and the header arrow.

Can I undo multiple sorts at once?

Yes, as long as the session has not been closed. Press Ctrl+Z (Command+Z on Mac) repeatedly to step back through each sort one at a time.

What is the best way to protect my data before sorting?

Add a numbered index column before you sort, and optionally save a copy of the workbook. Then the original order is always recoverable with a single sort by that column.

Why did sorting only part of my data scramble my sheet?

Sorting a single selected column sorts only that column, breaking row alignment. Click one cell inside the data and let Excel expand the selection, or select the full range before sorting. Use Undo immediately if this happens.