Function · Dynamic arrays
Excel FILTER function
The Excel FILTER function spills the rows that pass a test. Household amounts over $100 come back as rent and tuition.
Syntax =FILTER(array, include, [if_empty])
=FILTER(A2:B6,B2:B6>100,"None")Arguments
| Name | Required | What to pass |
|---|---|---|
| array | Required | The rows to return, including every column you want to see. |
| include | Required | A TRUE or FALSE for each row, the same height as array. Usually a test such as B2:B6>100. |
| if_empty | Optional | What to return when no row passes. If omitted, an empty result is the #CALC! error. |
Examples
Amounts over $100
=FILTER(A2:B6,B2:B6>100,"None")Result Two rows: Rent $1,900 and Tuition $800
| A | B | |
|---|---|---|
| 1 | Item | Amount |
| 2 | Rent | 1900 |
| 3 | Groceries | 86.40 |
| 4 | Tuition | 800 |
| 5 | Pharmacy | 30 |
| 6 | Dinner | 42 |
| 7 | Over $100 | Rent 1900; Tuition 800 |
FILTER returns the rows that pass a test and spills them, starting in the cell that holds the formula. Rent at $1,900 and tuition at $800 are the rows over $100. Groceries, the pharmacy, and dinner stay in the source list and do not appear in the spill. The spill is still one formula. Delete the formula and every result row goes with it.
If nothing matches and you left out if_empty, the result is #CALC!, not a blank. Pass "None" or "" so a quiet month does not look like a broken sheet. Excel 2019 and earlier do not have FILTER. SUMIFS still totals those rows there. It just cannot list them. The workbook needs empty cells below and to the right, or the spill stops with #SPILL!.