
Sorting puts data in order; filtering shows only the rows you care about.
AutoFilter
- Select a cell in the header row.
- Data > Filter or Ctrl + Shift + L.
- Click the arrow in a header and pick criteria.
There are separate filter options for text, numbers and dates: "contains", "greater than", "this month". Filter by colour lets you select coloured cells.
To remove a filter use Data > Clear or press Filter again.
Sorting
- Select a header cell and sort A to Z or Z to A from Data.
- Use Data > Sort for multi-column sorting (city first, then amount).
- Sort numeric columns such as sales from largest to smallest.
Custom sort
For logical orders such as months or priority (High, Medium, Low), use Sort > Order > Custom List.
Keeping data intact
- Select the whole table or one cell inside it; Excel detects the region automatically.
- Accept "Expand the selection"; otherwise only one column is sorted and rows come apart.
- Blank rows and columns split the region; clear them from the data.
- If you turn the data into a table with Ctrl + T, filter and sort buttons come automatically (see our Excel tables guide).
Microsoft 365: SORT and FILTER
They produce dynamic results without changing the data in place.
=SORT(A2:C100,3,-1) by column 3, descending
=FILTER(A2:C100,B2:B100="London") rows for London
=FILTER(A2:C100,(B2:B100="London")*(C2:C100>1000),"No results")
=UNIQUE(B2:B100) list of distinct citiesThe * sign means AND, + means OR. Results update on their own when the source changes.
Advanced filter
For complex conditions, Data > Advanced lets you define a separate criteria range and copy the result elsewhere.
Totals with filtered data
A normal SUM includes hidden rows. To total only the visible ones:
=SUBTOTAL(109,C2:C100)Common mistakes
- The filter isn't seeing some rows: there is a blank row in the data range.
- Numbers stored as text don't sort correctly.
- No header row: Excel may treat the first data row as the header.
For summary analysis, see our pivot table guide; to delete repeats, our remove duplicates guide.
Step-by-step example: finding the top 10 customers in a sales list
- Prepare the table: one header row, no blank rows and no merged cells.
- Turn on the filter: select a cell in the header and press Ctrl + Shift + L.
- Filter: from the "Region" column choose only "North."
- Sort: on the "Sales" column use Sort Largest to Smallest.
- Show the top 10: in the "Sales" filter use Number Filters > Top 10.
- Get a total: for the total of the results use
=SUBTOTAL(109,E2:E500); only visible rows are summed. - Copy the result: select the filtered area and copy it with Alt + ; (select visible cells only) and paste it on another sheet.
A multi-level sort example
To sort first by Region (A–Z), then within the same region by Sales (largest to smallest): Data > Sort > Add Level. Each region's best sales then appear at the top of its own group. You can also sort by a custom list (Monday, Tuesday…) or by cell colour.
Comparing filter types
| Filter | For what? |
|---|---|
| Text filter | Contains, begins with, equals |
| Number filter | Greater than, between, top N, above average |
| Date filter | This month, last week, quarter |
| Colour filter | Cell or font colour |
| Search box | A quick keyword |
| Advanced filter | Several conditions, copied output |
Frequently asked questions
Why does the filter not show some rows? There may be a blank row in the data range; Excel doesn't include what follows a blank row. Convert to a table (Ctrl + T) or select the whole range and turn on the filter (see our Excel tables guide).
How do I clear a filter without deleting? Remove it with Data > Clear; click the filter icon and choose "Clear Filter."
Does sorting break formulas? Relative references can shift when the order changes; before sorting make sure formulas use in-row references or convert them to values.
What should I do to keep the header out of the sort? Tick "My data has headers."
How do I make a filter permanent in a summary report? With a pivot table and slicer (see our pivot table guide).
Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.