Dynamic arrays function
Excel FILTER function
FILTER returns only the rows of a range that meet a condition, and it updates as the data changes. Use it to pull open orders, one region's sales, or anything over a target into its own live list.
=FILTER(array, include, [if_empty])Arguments
array- The range to return rows from.
include- A TRUE/FALSE test the same height as the range, like B2:B7="Shipped".
if_empty- Optional. What to show when nothing matches.
FILTER examples
Every result below was calculated from this sample sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order | Status | Rep | Total |
| 2 | SO-301 | Shipped | Ana | 420 |
| 3 | SO-302 | Pending | Ben | 180 |
| 4 | SO-303 | Shipped | Cy | 95 |
| 5 | SO-304 | Pending | Ana | 610 |
| 6 | SO-305 | Shipped | Ana | 240 |
| 7 | SO-306 | Cancelled | Ben | 75 |
Result: spills 2 rows × 4 columns
SO-302 Pending Ben 180 SO-304 Pending Ana 610 Spills every pending order with all four columns.
Result: spills 3 rows × 1 column
SO-301 SO-304 SO-305 Multiply tests for AND: Ana's orders over 200.
Result: 755
Feed the result into SUM to total shipped orders.
Result: None
No order is Returned, so the if_empty text appears.
Result: #CALC!
Without if_empty, no matches gives #CALC!.
How to use FILTER
- Click the top-left cell of an empty area.
- Type =FILTER( and select the data rows.
- Type a comma and a test on one column, like B2:B7="Pending".
- Add a message for no matches, then press Enter.
Common FILTER mistakes
No matches gives #CALC!
Add a third argument, like "None", so an empty result shows a message.
Using AND() or OR() inside FILTER
They collapse to one TRUE or FALSE. Multiply tests for AND and add them for OR.
Ranges of different heights
The include test must have the same number of rows as the array, or you get #VALUE!.
FILTER FAQ
How do I filter data with a formula in Excel?
Use =FILTER(A2:D50,C2:C50="West","None"). It returns every matching row and updates when the data changes.
How do I use FILTER with multiple conditions?
Multiply the tests for AND, like (B2:B9="Shipped")*(D2:D9>100). Add them for OR, like (C2:C9="Ana")+(C2:C9="Ben").
Why does FILTER return #CALC!?
Nothing matched and there was no if_empty argument. Add a third argument such as "No results".
Practice FILTER in these lessons
Guides that use FILTER
- XLOOKUP with multiple criteria
- How to count unique values in Excel
- How to compare two columns in Excel
- How to return multiple matches in Excel
- #SPILL! error in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Related functions
SORTSorts a range, spillsUNIQUERemoves duplicates, spillsXLOOKUPModern lookup in any directionSUMIFSAdds with several conditions
Updated