How to use FILTER in Excel
FILTER returns only the rows of a range that meet a condition. It works like AutoFilter, but the result is a live list that spills into the sheet and updates when the data changes.
Syntax
=FILTER(array, include, [if_empty])
array | The rows to return, e.g. A2:C500. |
include | A condition on one column, the same height as array, e.g. A2:A500="Sofia". |
[if_empty] | Optional. What to show when nothing matches, e.g. "None". |
Examples
=FILTER(A2:C500, A2:A500="Sofia")Every row for Sofia.=FILTER(A2:C500, C2:C500>1000)Every sale above 1000.=FILTER(A2:C500, (A2:A500="Sofia")*(C2:C500>1000))Both conditions: multiply them for AND.=FILTER(A2:C500, (A2:A500="Sofia")+(A2:A500="Varna"))Either city: add them for OR.Several conditions
Inside FILTER, multiply conditions for AND and add them for OR. Put each condition in brackets.
=FILTER(A2:D500, (B2:B500="North")*(D2:D500>10000))North region and above 10,000.=FILTER(A2:D500, (C2:C500="Overdue")+(C2:C500="Disputed"))Overdue or disputed items.Filter, then sort or count
Because FILTER returns a list, other functions can work on it directly.
=SORT(FILTER(A2:C500, C2:C500="Overdue"), 3, -1)Overdue items, largest amount first.=ROWS(FILTER(A2:A500, C2:C500="Overdue"))How many items are overdue.=FILTER(A2:C500, ISNUMBER(SEARCH("loan", B2:B500)), "None")Rows whose description contains loan.Common mistakes
- #CALC! error
- Nothing matches. Add the third argument:
=FILTER(A2:C500, C2:C500>5000, "None"). - #SPILL! error
- Something is in the way of the result. Clear the cells below and to the right.
- #VALUE! error
- The condition range has a different height from the data, e.g.
A2:C500andA2:A499.
Frequently asked questions
What's the difference between FILTER and AutoFilter?
AutoFilter hides rows in the original data. FILTER copies the matching rows somewhere else and keeps them updated as the data changes.
Why does FILTER return #CALC!?
No row matches. Add a third argument like "None" to show a message instead.
How do I filter with two conditions?
Multiply them for AND: (A2:A500="Sofia")*(C2:C500>1000), add them for OR.
Does FILTER work in older Excel?
No. It needs Microsoft 365 or Excel 2021 and later. In older versions use AutoFilter or INDEX with SMALL.
Available in: Microsoft 365, Excel 2021 and newer, Excel for the web, Google Sheets