Sorting and Filtering in Excel: A Practical Guide
Why does your spreadsheet feel impossible to read the moment it passes a few hundred rows? That's not a you problem — it's a structure problem. Sorting and filtering in Excel exist to solve exactly one thing: turning a data range you can't act on into one you can. Once you know how to sort data in Excel and filter data in Excel, a 2,000-row logistics report stops being a wall of noise and starts answering real questions. The only prerequisite before any of this works is a clean, structured table: column headers in row one, no merged cells, one piece of data per cell.
This guide walks through sorting, filtering, and the modern SORT and FILTER functions that most beginner articles skip entirely. I'll also cover the mistakes that come up every weekday morning on Excel forums, because the same three things trip people up over and over.
If you're brand new to Microsoft Excel and need to build that foundation first, the Excel for Beginners starter guide is the right place to start.
|
| A structured table with headers is all you need to start sorting and filtering in Excel. |
Step 1: Sort Data in Excel by One Column or Multiple Columns at Once
Sorting means reordering your rows. You're not hiding anything — you're rearranging records so the most useful order rises to the top. For a regional logistics orders dataset, that might mean sorting by ship date, by region, or by order value depending on what question you're answering.
Sort a single column using the Data tab
Click any cell inside your data range, then go to Data → Sort A to Z (or Z to A). Excel will expand the selection to include all adjacent columns automatically, which is what you want — otherwise you'd scramble your rows. If Excel asks whether to expand the selection, always choose yes.
On a Mac the steps are nearly identical, though there are a few interface differences covered in the Sorting and Filtering in Excel on Mac guide.
Sort multiple columns in Excel with a custom sort
One sort level is rarely enough. In a Q3–Q4 2024 Regional Logistics Orders dataset, you might want to sort by Region first, then by Ship Date within each region. That's what custom sort is for. Go to Data → Sort and use the Add Level button to stack your sort criteria in the right order.
The date trap is worth flagging here. When you sort data by date in Excel, you'll occasionally find Excel sorts some dates alphabetically — "January 3" landing before "February 1" as if they were words. The cause is almost always dates stored as text. If your dates were imported from another system, check the cell format. Real dates right-align in a cell by default; text-dates left-align. Fix the format first, then re-sort.
For a deeper look at multi-level sort logic, the Multi-Level Sorting in Excel guide goes further than this article can cover.
Step 2: Filter Data in Excel Using AutoFilter, Multiple Criteria, and the FILTER Function
Once your data is sorted into a sensible order, filtering lets you focus on a subset without deleting anything. Hidden rows are still there — they're just out of the way temporarily.
Turn on AutoFilter and filter by value or color
Click inside your table, then go to Data → Filter. Dropdown arrows appear in your header row — those are your AutoFilter controls. Click any arrow to filter by value, by text condition, or by cell color if you've used color-coding in your sheet. Filter by color in Excel is genuinely useful for flagging exceptions: if you've manually highlighted late shipments in red, you can surface all of them in two clicks.
In Microsoft 365, converting your range to a formal table (Insert → Table) gives you AutoFilter arrows automatically, and they stay intact when you add rows.
Use the FILTER function for a dynamic, formula-based result
AutoFilter is manual — you click dropdowns every time your data changes. The FILTER function in Excel 365 does this automatically with a formula. It's one of the dynamic array functions introduced in Microsoft 365, and it's more useful than most beginner tutorials let on.
The basic syntax is =FILTER(array, include, [if_empty]). To pull all orders from the Northeast region:
=FILTER(A2:F500, C2:C500="Northeast", "No results")
That third argument — if_empty — is not optional in production. A FILTER-function dashboard running without it will throw a #CALC! error the moment no rows match your criteria: not a blank, not a zero — a loud red error that breaks the whole report. Always include a fallback like "No results" or "".
To filter with multiple criteria in a single formula, use multiplication for AND logic and addition for OR logic inside the include argument. For example, Northeast AND Q4 orders only:
=FILTER(A2:F500, (C2:C500="Northeast")*(D2:D500="Q4"), "No results")
Step 3: Combine the SORT and FILTER Functions Into One Formula
This is the part most beginner guides never reach, and it's worth staying for.
You can nest the SORT function inside the FILTER function so the result comes back already sorted — no manual reordering after the filter runs. For the logistics dataset, here's what returning all Northeast Q4 orders sorted by Ship Date looks like:
=SORT(FILTER(A2:F500, (C2:C500="Northeast")*(D2:D500="Q4"), "No results"), 4, 1)
The 4 is the column number within the filtered result to sort by; the 1 means ascending order. Change it to -1 for descending.
This SORT and FILTER combination is a staple for anyone building live dashboards in Microsoft 365. The entire output refreshes whenever the source data changes — no pivot table, no helper columns, no re-filtering by hand.
These are dynamic array functions available in Excel 365 and Excel 2021 and later. If your organization is on an older version, use the manual AutoFilter approach instead.
Common Mistakes When Sorting and Filtering in Excel (and How to Fix Them Fast)
The same failures come up every single week on the Excel subreddit and MrExcel forums. Here are the three most common.
- Dates sorting as text. If sorting by date produces a result that looks alphabetical rather than chronological, your dates are stored as text. Use Data → Text to Columns with Date format to convert them, or use
=DATEVALUE()on the column. Dates imported from external systems often look fine visually but are text masquerading as dates. - SUM returns unexpected results after filtering. Regular SUM includes hidden rows. Switch to
=SUBTOTAL(9, range)— it respects your active AutoFilter and totals visible rows only. - AutoFilter arrows disappear. This almost always means there are merged cells somewhere in the header row. Merged cells look clean for about five seconds and then break everything they touch. Unmerge your headers and the arrows come back.
A quieter problem that breaks both sorting and filtering: invisible characters from imported data. "East" and "East " (with a trailing space) are not the same value — FILTER won't match them and sort order goes sideways. Run =TRIM() to strip extra spaces and =CLEAN() to remove non-printable characters before you trust any result. Check your data quality before you sort or filter, not after.
Frequently Asked Questions
What is the difference between sorting and filtering in Excel?
Sorting reorders all rows in your data range based on the values in one or more columns — nothing gets hidden. Filtering hides rows that don't match your criteria, leaving only the matching rows visible. Both tools work on the same data range; they just answer different questions.
Why is my Excel sort not working correctly?
The most common cause is data stored in the wrong format, especially dates or numbers saved as text. Text-formatted values sort differently than real dates or numbers, producing results that look alphabetical instead of chronological or numerical. Check your cell formats and use TRIM and CLEAN to remove invisible characters from imported data before sorting.
How do you use the FILTER function in Excel?
The FILTER function syntax is =FILTER(array, include, [if_empty]). The array is your data range, the include argument is a logical condition that returns TRUE or FALSE for each row, and the if_empty argument specifies what to return when no rows match — always include it to avoid a #CALC! error. FILTER is available in Microsoft 365 and Excel 2021 and later.
How do you combine SORT and FILTER in one formula?
Nest the FILTER function inside SORT: =SORT(FILTER(array, criteria, if_empty), sort_column, sort_order). FILTER runs first and returns the matching rows; SORT then orders that result by whichever column you specify. The entire output refreshes automatically when your source data changes.
Join the conversation