Home › Excel functions › FILTER
Excel FILTER Function: Filter Formula with Multiple Criteria
FILTER returns all rows from a range that meet a condition, and the result updates automatically when the data changes. Where VLOOKUP and XLOOKUP return one match, FILTER returns every match.
In this guide
FILTER syntax
=FILTER(array, include, [if_empty])| Argument | What it means |
|---|---|
| array | The range to return rows from. |
| include | The condition, written as a comparison on a column, such as A2:A6="North". |
| if_empty (optional) | What to show when no rows match, such as "No results". |
Availability: FILTER works in Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. Older versions show #NAME?.
Basic example: all sales for one region
| A | B | C | |
|---|---|---|---|
| 1 | Region | Rep | Sales |
| 2 | North | Anna | 1,200 |
| 3 | South | Ben | 800 |
| 4 | North | Chris | 950 |
| 5 | East | Dana | 450 |
| 6 | South | Anna | 700 |
Type this in one cell, say E2, and Excel "spills" the result into the cells below and to the right:
| E | F | G | |
|---|---|---|---|
| 2 | North | Anna | 1,200 |
| 3 | North | Chris | 950 |
Add a new North row to the source and it appears in the result automatically. Put the condition in a cell to make it a dropdown-style report: =FILTER(A2:C6, A2:A6=H1).
Multiple criteria: AND and OR
Put each condition in brackets and combine them with * for AND, or + for OR.
- AND: South region and sales above 750:
=FILTER(A2:C6, (A2:A6="South")*(C2:C6>750))returns Ben's 800. - OR: North or East:
=FILTER(A2:C6, (A2:A6="North")+(A2:A6="East"))returns Anna, Chris and Dana.
This works because TRUE counts as 1 and FALSE as 0: multiplying only gives 1 when both are true, adding gives at least 1 when either is.
When nothing matches
If no rows meet the condition, FILTER returns #CALC!. Add the third argument to show a message instead:
Sort, count or sum the results
- Sort the result by sales, highest first:
=SORT(FILTER(A2:C6, A2:A6="North"), 3, -1) - Return only some columns: filter just the reps and sales with
=FILTER(B2:C6, A2:A6="North") - Count the matches:
=ROWS(FILTER(A2:C6, A2:A6="North")) - Unique values from the filtered list: wrap it in UNIQUE.
Common errors
- #SPILL!: there's something in the cells where the result wants to go. Clear them.
- #CALC!: nothing matches. Add an
if_emptyvalue. - #VALUE!: the
includerange has a different height thanarray. - #NAME?: your Excel version doesn't have FILTER.
Frequently asked questions
What's the difference between FILTER and the filter button?
The filter button (Data › Filter) hides rows in the original table. The FILTER function creates a separate, live copy of the matching rows somewhere else, leaving the original untouched.
Can FILTER use wildcards?
Not directly. To filter on partial text, use ISNUMBER and SEARCH: =FILTER(A2:C6, ISNUMBER(SEARCH("an", B2:B6))) returns every rep whose name contains "an".
Can FILTER return results from another sheet?
Yes. The ranges can be on any sheet, for example =FILTER(Data!A2:C100, Data!A2:A100="North").
How is FILTER different from XLOOKUP?
XLOOKUP returns the first match. FILTER returns every matching row.