Sort a Filtered List in Excel Without Mixing Up Rows

Formulas & functions · Updated November 20, 2026

To sort a filtered list in Excel, open the filter arrow in the column you want to sort, then choose an ascending or descending option, such as Sort A to Z or Sort Largest to Smallest. Excel rearranges the list’s rows as records, so values in each row stay together; the filter continues to control which records are visible.

What sorting a filtered list does

A filter hides rows that do not meet your criteria; it does not remove those records from the worksheet. Sorting changes the order of records according to values in a selected column. For example, if a sales table is filtered to show the West region, sorting the Revenue column from largest to smallest puts the highest-revenue West records first in the displayed results.

Use the arrow in a column header to sort the filtered results without selecting and moving cells manually. Avoid sorting just one column by selecting its cells and using a ribbon sort command: that can separate values from the other fields in their records if Excel does not expand the selection as intended. A sort should move complete rows, not detach names, dates, or amounts from their related information.

Filtered-out records remain in the worksheet. When you clear the filter, those records become visible again. If your goal is to establish a new order for every record in the whole dataset, rather than arrange the currently displayed matches, clear the filters, sort the full table or range, and then apply the filters again.

Sort from a column’s filter arrow

These steps apply to Excel for Microsoft 365 on Windows. The same basic filter and sort commands are available in Excel for Mac and Excel for the web, though ribbon layout and keyboard shortcuts can differ.

  1. Click the filter arrow in the header of the column you want to use. If the arrow is not visible, click a cell in the data and select Data > Filter. The data needs a header row so Excel can identify the fields.
  2. Choose the appropriate sort command. Text columns usually offer Sort A to Z or Sort Z to A. Numeric columns offer Sort Smallest to Largest or Sort Largest to Smallest. Date columns offer oldest-to-newest or newest-to-oldest choices.
  3. Check the visible rows. They should now appear in the selected order, while the active filter continues to hide records that do not match its criteria.
  4. If you want to see all records again, open the relevant filter arrow and choose Clear Filter From, followed by the column name. To remove all active filters, use Data > Sort & Filter > Clear.

You can also use the sort buttons on the Data tab when you want a straightforward sort. Before using them, click inside the data and confirm that Excel is treating the records as one range or table. The column-arrow method is convenient when you are already filtering a particular field because it puts the filter and sort choices in the same menu.

Set up the data so rows stay together

A reliable sort starts with a clean rectangular dataset: one header row, one record per row, and one field per column. Avoid blank rows or blank columns inside the data. A completely blank row can make Excel interpret the records below it as a separate range, leaving them out of the sort.

For a frequently updated list, convert the range to an Excel table. Click in the data and press Ctrl+T on Windows, confirm the range, and check My table has headers if the first row contains field names. Select OK. Tables add filter arrows to their headers, expand when new rows are added directly below them, and help keep related fields together during sorting. On Mac, use Insert > Table if the shortcut differs in your Excel setup.

Give headers distinct, descriptive names such as Order Date, Region, and Revenue. Avoid merged cells in the data area; merged cells can prevent sorting or lead to confusing results. Put titles, notes, and totals outside the sortable records, or use table features designed for totals, rather than placing extra lines among the data.

Sort by more than one column

A single-column sort is not always enough. If several records have the same primary value, Excel needs a second rule to determine the order within that group. For example, you might sort a service list first by Department and then by Last Name.

  1. Click a cell in the table or range. If you want to order the entire dataset, clear active filters first.
  2. Select Data > Sort to open the Sort dialog box.
  3. Check My data has headers so Excel does not treat the header row as an ordinary record.
  4. Choose the primary field in Sort by, select the relevant sort basis and order, and then select Add Level.
  5. Choose the next field under Then by. Add further levels if needed, then select OK.

For example, sort by Department A to Z and then by Last Name A to Z to group employees by department and alphabetize each group. If the list is filtered, remember that the filter still limits what is displayed. Clear filters first when you need to inspect or set the order of every record in the dataset.

Custom orders and useful examples

Alphabetical order is not always the order a workplace needs. A project tracker might need the sequence Not started, In progress, Waiting, Complete, while an urgency field might need Critical, High, Medium, Low. In the Sort dialog, open the Order list and choose Custom List when a suitable built-in order is available, or create a custom list in Excel’s options and use it as a sort order. The labels in the data need to match the intended categories consistently.

Some practical choices include:

  • For an invoice list filtered to one customer, sort Invoice Date oldest to newest to follow the history of the account.
  • For inventory filtered to one warehouse, sort Quantity smallest to largest to bring low-stock items to the top.
  • For a task list filtered to open tasks, sort Due Date oldest to newest to see the nearest deadlines first.

These are ordering choices, not changes to the filter criteria. If the filtered results seem to change after a sort, inspect the filter indicators and criteria; the sort itself should not delete records.

Common sorting problems and fixes

Numbers sort like text. If values such as 2, 11, and 100 appear in an unexpected order, some entries may be stored as text. Look for inconsistent formatting, leading apostrophes, or spaces. Convert the affected values to numbers consistently, then sort again. Do not convert a field that is intentionally an identifier, such as a postal code, where leading zeros may matter.

Dates are out of order. Dates stored as text can sort alphabetically rather than chronologically. Check whether the cells use real Excel date values and whether entries follow a consistent date format. If a date column contains a mixture of true dates and text, standardize it before relying on the sort.

Only part of the list moves. Check for blank rows or columns that split the range, and verify that the correct table or range is included. A table usually makes the intended boundaries clearer. Also check whether some records are outside the table because they were added with a blank row in between.

Rows seem mismatched after sorting. Undo immediately with Ctrl+Z on Windows if the result is wrong, then sort again from a cell inside the complete range or table. Do not select a single field and sort it independently. If rows were manually hidden, unhide them before a full-range sort so you can inspect all records and avoid uncertainty about hidden data.

The sort arrow is missing or inactive. Confirm that filters are enabled with Data > Filter, that the data has a clear header row, and that the worksheet is not protected in a way that prevents sorting. If the data is in a table, use its header arrow. If the sort order looks wrong, check for extra spaces, inconsistent spelling, or mixed data types in the sort column.

Filter sort versus sorting the whole dataset

Filtering and sorting answer different questions. A filter asks which records should be displayed; a sort asks in what order records should appear. You can apply both at once—for instance, show only open orders and arrange those results by due date. Changing the order does not mean the other orders have been erased.

Use the header dropdown when you want to sort from the field you are filtering and review the resulting visible list. If you need a carefully controlled order across the whole dataset, clear the filters and use Data > Sort on the complete table. Then apply the filter criteria again. This approach also makes it easier to confirm that all records are included in a multi-level sort.

On Excel for Mac and Excel for the web, the sort and filter controls may be arranged differently from the Windows ribbon, but the column-header dropdown remains the main place to filter and sort a table. On Windows, Ctrl+Shift+L toggles filters for a selected data range; on a Mac, use Data > Filter if that shortcut is not mapped in your version.

Frequently Asked Questions

Can I sort only the rows that are visible after filtering?
Use the sort command in the column’s filter dropdown to arrange the results shown for that filtered list. If you specifically need a full, confirmed ordering of every record, clear the filter and sort the complete table or range before filtering again.

Does sorting a filtered list delete the hidden rows?
No. A filter hides records from view; it does not delete them. Clear the filter to display records that did not meet the criteria.

Can I sort a filtered list by two columns?
Yes. Clear filters if you need to sort the entire dataset, then choose Data > Sort, set the first field, and use Add Level to specify the next field. The second rule orders records that tie under the first rule.

Why does Excel sort 100 before 20?
The values may be stored as text rather than numbers. Check the cell format and underlying values, make the column consistent, and sort again. Text sorting follows character order, not numeric magnitude.

How do I restore the original order?
If you have not made other changes since sorting, press Ctrl+Z on Windows or Command+Z on Mac. For a dependable way to restore a source order later, add an index or sequence column before sorting; you can sort by that column to return records to their saved order.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.