How to filter data by a condition in Excel
Show only the rows that meet a condition, such as region equals East or amount over 500, with the Filter button or the FILTER function.
A filter hides every row that fails a test, so you can read or copy just the rows you care about. Nothing is deleted, and clearing the filter brings everything back.
The Filter button is the quick way to look at part of a table. The FILTER function does the same job in a formula and writes the matching rows somewhere else.
Steps in Excel for Windows
- Turn the filter on. Click any cell in the table and press Ctrl+Shift+L, or choose Data, Filter. Drop-down arrows appear in the header cells.
- Open the column's drop-down. Click the arrow in the column you want to test, for example Amount.
- Choose a filter type. For text columns the menu shows Text Filters, with Equals, Begins With, Contains and more. For numbers it shows Number Filters, with Greater Than, Between, Top 10 and others. For a single value, just tick it in the list.
- Enter the condition. Pick Greater Than, type 500, and click OK. Rows that do not qualify are hidden, not deleted, and the row numbers of the rest turn blue.
- Add conditions in other columns. Filter a second column and Excel shows only rows that meet both. Filters across columns combine with AND.
- Clear the filter. Data, Clear removes the conditions and shows every row again. Alt, A, C does the same. Press Ctrl+Shift+L to remove the drop-downs.
Worked example
1. Amount greater than 500
| A | B | C | |
|---|---|---|---|
| 1 | Order | Region | Amount |
| 2 | 1001 | East | 320 |
| 3 | 1002 | West | 640 |
| 4 | 1003 | East | 710 |
| 5 | 1004 | North | 150 |
| 6 | 1005 | West | 520 |
| A | B | C | |
|---|---|---|---|
| 1 | Order | Region | Amount |
| 3 | 1002 | West | 640 |
| 4 | 1003 | East | 710 |
| 6 | 1005 | West | 520 |
Orders 1002, 1003 and 1005 pass the test, so only those rows stay visible. Notice the row numbers on the left: 3, 4 and 6. The hidden rows 2 and 5 are still in the sheet, just out of sight.
2. Region equals East
| A | B | C | |
|---|---|---|---|
| 1 | Order | Region | Amount |
| 2 | 1001 | East | 320 |
| 3 | 1002 | West | 640 |
| 4 | 1003 | East | 710 |
| 5 | 1004 | North | 150 |
| 6 | 1005 | West | 520 |
| A | B | C | |
|---|---|---|---|
| 1 | Order | Region | Amount |
| 2 | 1001 | East | 320 |
| 4 | 1003 | East | 710 |
Two orders are in the East, in sheet rows 2 and 4. A filter on text ignores capitals, so "east" would match too.
3. The same condition as a formula
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Order | Region | Amount | ||||
| 2 | 1001 | East | 320 | 1002 | West | 640 | |
| 3 | 1002 | West | 640 | 1003 | East | 710 | |
| 4 | 1003 | East | 710 | 1005 | West | 520 | |
| 5 | 1004 | North | 150 | ||||
| 6 | 1005 | West | 520 |
In Microsoft 365 and Excel 2021, FILTER returns the matching rows to a separate area and leaves the source alone. The formula in E2 spills three rows and three columns.
Common mistakes
- Thinking filtered rows are gone. They are only hidden. If you copy a filtered range, Excel copies just the visible rows, which is helpful. If you delete rows, you delete only the visible ones.
- Filtering a range with blank rows. A blank row inside the data stops the automatic range. Excel filters only the block above or below it. Remove blank rows first or select the whole table before turning the filter on.
- Forgetting a filter is on. A funnel icon on a drop-down and blue row numbers show an active filter. The status bar reads something like 3 of 5 records found. A total that looks too small often means a forgotten filter.
- Using SUM on a filtered list. SUM adds hidden rows too. To add only what is visible, use SUBTOTAL with 109 as the first argument.
- Text that looks like a number. When a column of figures is mostly text, Excel offers Text Filters instead of Number Filters. That is a sign the numbers are stored as text, so convert the column before filtering.
On Excel job tests
Prompts may say "show only the orders from the East region", "display orders over $500" or "filter to the last quarter". The first wants a simple filter, the second a Number Filter with Greater Than, the third a Date Filter.
A prompt that says "without using the filter button" or "in a separate area" is asking for FILTER. If the task asks for a total of the visible rows, SUBTOTAL(109, range) is the answer rather than SUM.
Related guides
Questions
- What is the shortcut to turn a filter on and off?
- On Windows, Ctrl+Shift+L toggles the filter drop-downs. Alt, A, C clears the conditions without removing the drop-downs.
- How do I filter by two conditions on the same column?
- Open the Number Filters or Text Filters menu, choose Custom Filter, and enter two conditions joined by And or Or.
- Does filtering delete the other rows?
- No. The other rows are hidden and come back when the filter is cleared.
- How do I total only the filtered rows?
- Use
=SUBTOTAL(109,range). The 109 tells Excel to sum and skip rows hidden by a filter.
Practice this
The free lesson AutoFilter has checked exercises for this skill in a working grid.
Practice this skill