To undo an A-to-Z sort in Excel, press Ctrl+Z right away (Command+Z on Mac). If you have already made other changes, Excel may not be able to recover the previous row order: use a saved original-order column, a backup, or version history. If you only want to show hidden rows, clear the filter instead; filtering and sorting are different actions.
This guide covers Excel for Microsoft 365 on Windows. It explains how to undo a recent sort, clear filter criteria, remove filter arrows, and restore a known order without accidentally separating values from their records.
What You’ll Need
- The workbook open in Excel. If you are restoring a particular order, you will also need an original-order column, a saved copy, or another reliable record of that order.
- Permission to edit the workbook. If it is read-only or protected, you may need to save an editable copy or ask the owner to unlock the relevant range.
Step-by-Step
-
Check whether you sorted, filtered, or both. Look at the column headings and the visible rows. A small arrow in a heading can be the filter menu; a funnel icon generally indicates that a filter is active. A sort may put the values in alphabetical order while keeping every row visible. A filter hides rows that do not match a condition. These can be used together, so clearing one does not necessarily undo the other.
Before changing anything else, note the affected column and whether some records are hidden. If several columns have arrows or funnel icons, the data may be a table or a filtered range. Do not select just one column and sort it again: that can detach names, dates, or other fields from the records they belong to.
-
Undo the sort if it was your most recent action. On Windows, press Ctrl+Z once. On a Mac, press Command+Z. Check that the rows return to their previous arrangement before continuing. If the first undo reverses a different action, do not keep pressing the shortcut blindly; each press reverses another step and could undo useful work.
Undo is the simplest way to recover the exact prior order, but it works only while the sort remains in Excel’s undo history. Closing the workbook, clearing the undo history, or making many later edits can make this route unavailable. Save a recovered workbook once the order is correct.
-
Clear an active filter if your goal is to reveal every row. Click a cell in the filtered range or table, open the Data tab, and choose Clear in the Sort & Filter group. This clears active filter criteria so matching and nonmatching records can be shown again. It does not guarantee that the rows return to the order they had before an A-to-Z sort.
You can also open the filter menu for a particular column and choose its clear-filter command, if displayed, to remove that column’s criterion. This is useful when you want to keep filters on other columns. To show all records, confirm that no other column is still filtering the range.
-
Restore a known order using an original-order column. If the data includes a field such as Record ID, Entry Number, or Original Position that represents the intended sequence, click inside the data. On the Data tab, select Sort, choose that field in the sort dialog, and set the order that matches its values, such as smallest to largest. If Excel asks whether to expand the selection, choose Expand the selection so each entire row moves together.
For example, suppose an Original Position column contains 1, 2, 3, and so on beside each record. Sorting that column from smallest to largest restores the saved sequence. If the identifier is text, choose the appropriate A-to-Z or Z-to-A order instead. Check several records against what you know before saving.
-
Use a backup or version history if there is no order field. Excel cannot infer the original arrangement from an already sorted list: a sort changes where rows sit, and the previous position is not automatically stored as a recoverable column. If Undo is no longer available, compare the workbook with a copy made before sorting, or use the file’s version history if it is stored in OneDrive or SharePoint.
To check version history for a cloud workbook, select the file name or open the workbook’s version history option, then inspect an earlier version before restoring it. Be careful: restoring a whole earlier version can discard edits made since then. If those edits matter, copy the needed records into a separate working copy rather than replacing the current file immediately.
-
Remove filter arrows only if you no longer need filtering. Click inside the data and choose Data > Filter to turn the filter controls off for the selected range. This hides the dropdown arrows; it is not a way to recover an earlier row order. For a formatted Excel table, the arrows are table filter buttons. If toggling Data > Filter does not remove them, select the table and look for the Filter Button option on Table Design.
On Excel for Mac, use the equivalent commands on the Data tab where available, and use Command+Z for undo. Excel for the web has similar filter and sort controls; Ctrl+Z works in the Windows browser, while Mac users use Command+Z. Ribbon layout can vary slightly by platform, so check the Data tab if a control is grouped differently.
Common Mistakes
- Expecting Clear to reverse a sort. The Data tab’s Clear command is for clearing filter criteria; it does not reliably restore the exact pre-sort sequence. Use Undo, an order field, or an earlier copy to recover that sequence.
- Confusing a funnel with a sort. A filter hides records; a sort rearranges them. Clearing a filter can reveal rows that were hidden, but those rows may still be in alphabetical order.
- Sorting only one column. Sorting a single selected column without its related data can mix values between records. If Excel prompts you, expand the selection. When the prompt does not appear, confirm that you clicked within the complete table or range before sorting.
- Choosing a random sort direction. Sorting Z-to-A after A-to-Z reverses the alphabetic sequence, but it does not restore an earlier custom order. It may also change the order of records that have matching values.
- Saving over the only copy too soon. If the order matters and recovery is uncertain, save a separate copy before trying additional sorts or restoring a previous version.
Tips
- Add an order number before sorting. For future work, insert an Original Position column and fill it with a unique sequence before you sort. That gives you a dependable way to return to the initial arrangement later. Keep the numbers with the records when sorting.
- Use a stable identifier where possible. Customer ID, invoice number, or another unique key can restore a meaningful order if that was the order you need. A name column is less dependable if names repeat or the original arrangement was not alphabetical.
- Make the whole dataset a table. Select the complete dataset and use Insert > Table if a table is appropriate. Table sorting keeps record fields together and makes filter controls easier to manage. Ensure the selected range includes all relevant columns and that the header option is correct.
- Keep a clean source copy. Before substantial sorting, filtering, or cleanup, save a separate workbook copy. This is especially helpful when the source order has business meaning or there is no unique position field.
- Check hidden rows before interpreting totals. A filter can hide records without deleting them. After clearing it, verify that all expected rows are visible and that any totals or summaries reflect the records you intend to include.
Troubleshooting
Ctrl+Z does not restore the order. Confirm that Excel has focus and that you are undoing the sort, not a later edit. If the sort is no longer in the undo history, stop experimenting on the only copy. Look for an order column, a pre-sort copy, or a OneDrive or SharePoint version that predates the sort.
Some rows are still missing. Another column may have an active filter, or the filter may cover only part of the dataset. Open the dropdowns and clear remaining criteria, or click inside the data and use Data > Sort & Filter > Clear. If rows remain hidden, check for manually hidden rows as well: select the surrounding row numbers, right-click, and choose Unhide when that option is available.
The sort rearranged only part of each record. Undo immediately if possible. Then check whether the data range has blank rows or columns that caused Excel to detect a smaller region. Select the entire data range, including all fields, and sort again with the option to expand the selection. Review a few records afterward to confirm their related values stayed together.
The Filter command does not remove table arrows. Click inside the table and open Table Design. In Table Style Options, clear Filter Button if that option is shown. This changes the display of the table’s filter buttons; it does not undo a sort or erase the table’s data.
Version history is unavailable. The workbook may be saved only on your device, or version history may not be enabled for its location. Check for a manually saved copy, an organizational backup, or another source file. If no earlier copy or order marker exists, the exact former sequence may not be recoverable.
Frequently Asked Questions
Can I clear an A-to-Z sort without undoing other changes?
If you have an original-order column, sort by it to restore that sequence. Without one, Excel generally has no way to know the previous order once the sort is no longer undoable. A backup or earlier version may be the only exact recovery.
Does Data > Clear remove the sort?
It clears active filter criteria so filtered-out records can reappear. Do not rely on it to put rows back where they were before sorting. Use Undo or sort by a field that records the desired order.
How do I clear a filter but keep the dropdown arrows?
Use Data > Clear to remove filter criteria while leaving filter controls available. You can then apply a different filter from a column’s dropdown.
How do I remove the dropdown arrows but keep all the data?
Turn off filtering with Data > Filter for a normal filtered range. For an Excel table, clear the Filter Button option under Table Design if it is available. Neither action deletes records.
Will sorting A-to-Z keep each row together?
It should when you sort a complete range or table and expand the selection to include related columns. Sorting only a single column can misalign the data, so check the selection and any prompt before confirming.
Can I restore the previous order after closing Excel?
Possibly, if the workbook has a saved original-order field, an earlier copy, or available version history. If none exists and the sort is no longer in Undo, Excel cannot reliably reconstruct the former order from the sorted values alone.
Related
- How to Change a Link Name in Excel
- How to Change Every Other Row Color in Excel Automatically
- Indian Number Format in Excel: Apply Lakhs and Crores
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Sum Same Cell Across Tabs: The 3-D Formula GuideIf the sheets you want to total are next to one another in the workbook, use a 3-D…
- How to Find the Average Date in Excel With a FormulaIf your dates are in A2:A10, enter =AVERAGE(A2:A10) in an empty cell, then format that cell as a…
- How to Add Filter Options in Excel: A Step-by-Step GuideTo add filter options in Excel for Microsoft 365 on Windows, select a cell in your data, then…
- Excel Slicer to Filter Data: How to Set Up and Use ItTo filter data with an Excel slicer, select a table cell and choose Table Design > Insert Slicer,…
- Excel Formula for a List of Numbers: 10 Useful OptionsTo create a list from 1 to 10 in Excel, enter =SEQUENCE(10) in an empty cell; it spills…
- CAGR Calculation in Excel: Formula, Steps, and ExamplesTo calculate CAGR in Excel, divide the ending value by the starting value, raise the result to the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.