FILTER
FILTER(array, include, [if_empty])
array is the range to return. include is a TRUE/FALSE test for each row, the same height as array. if_empty is what to return when no row passes. The result spills.
Use the FILTER function when you want a live list or a total of the rows that pass a test. It spills the matching values and recalculates when the source changes. It needs Excel 2021, Microsoft 365, or Google Sheets. Advanced Filter is the Data-tab command in Excel, including versions that have no FILTER function. It copies or hides rows once. It does not recalculate until you run it again.
FILTER(array, include, [if_empty])
array is the range to return. include is a TRUE/FALSE test for each row, the same height as array. if_empty is what to return when no row passes. The result spills.
Data > Advanced (a command, not a function)
You point it at a list range and a criteria range. The criteria range repeats the column headers. Criteria on the same row are AND. Criteria on different rows are OR. Copy to another place, or filter the list in place. There is no formula to copy.
SUMIF(range, criteria, sum_range)
If you do not need the matching rows themselves, SUMIF or SUMIFS returns the total without a spill. That works in older Excel too.
| Question | FILTER | Advanced Filter | SUMIF |
|---|---|---|---|
| What it is | A function | A ribbon command | A function |
| Updates when source data changes | Yes | No. Run it again | Yes |
| Returns the rows | Spills them | Copies them or hides the others | No. It returns a total |
| AND and OR | Multiply tests for AND. Add tests for OR | Same row is AND. Next row is OR | One test. SUMIFS for AND |
| No match | #CALC! unless you pass if_empty | The destination stays empty | 0 |
| Versions | Excel 2021, Microsoft 365, Google Sheets | Desktop Excel, including older versions | Current and older Excel, Google Sheets |
The include test A2:A5="East" is true on three rows. FILTER spills those amounts. SUM around FILTER adds them without leaving the list on the sheet. SUMIF does only the total.
| Row | A | B | C |
|---|---|---|---|
| 1 | Region | Product | Amount |
| 2 | East | Pen | 10 |
| 3 | West | Pen | 40 |
| 4 | East | Book | 30 |
| 5 | East | Pen | 20 |
=FILTER(C2:C5,A2:A5="East") → 10=SUM(FILTER(C2:C5,A2:A5="East")) → 60=SUMIF(A2:A5,"East",C2:C5) → 60The spill is 10, then 30, then 20, in that order, which is the order the East rows appear. The West 40 is not in the spill. The sum of the spill is 60, the same figure SUMIF returns. In a graded drill, SUM of FILTER fits in one cell. The spill itself needs empty cells underneath the formula.
South matches nothing. Without a third argument, FILTER has no rows to return. The third argument is the value to show instead.
| Row | A | B | C |
|---|---|---|---|
| 1 | Region | Product | Amount |
| 2 | East | Pen | 10 |
| 3 | West | Pen | 40 |
| 4 | East | Book | 30 |
| 5 | East | Pen | 20 |
=FILTER(C2:C5,A2:A5="South","None") → Noneif_empty is used only when the include test is false for every row. It is not a substitute for IFERROR. A mistake in the formula, such as ranges of different heights, is still an error.
A list of this month's open orders, or the East amounts under a heading, should be a formula so the next refresh does not depend on someone re-running a command. Excel 2021, Microsoft 365, and Google Sheets can do that.
Set up a criteria range with the same headers as the list. Put East under Region to keep East rows. Put East under Region and Pen under Product on that same criteria row to require both. Put West on the next criteria row to add West as OR. Copy the result to a destination. It will not follow later edits until you run Advanced Filter again.
A dashboard total does not need a spill. SUMIF is shorter, and it runs in workbooks that have never heard of FILTER. The East total in the example is 60 either way.
FILTER(C2:C5, A2:A4="East") does not pair the last amount with a test. The include argument has to be one TRUE or FALSE per row of the array.
If E3 already contains a label, the FILTER in E2 cannot spill and Excel shows #SPILL!. Clear the cells the result needs, or wrap FILTER in SUM when you only wanted the total.
Two tests are multiplied: (A2:A5="East")*(B2:B5="Pen"). That product is the include argument. There is no AND keyword between the comparisons.
You cannot type =ADVANCEDFILTER. The command uses a criteria range. People sometimes rebuild that criteria range by hand and forget that same-row criteria are AND.
FILTER is in Excel 2021, Excel 2024, Microsoft 365, Excel for the web, and Google Sheets. It is not in Excel 2019 or earlier. There the formula returns #NAME?.
Advanced Filter is a desktop Excel feature on the Data tab. Google Sheets does not have that dialog. Google Sheets has filter views and the FILTER function. A criteria range you built for Advanced Filter does not run itself in Google Sheets.
When no row matches and you omit if_empty, Excel's FILTER returns #CALC!. The example passes "None" so the result is a label instead. SUMIF of a miss returns 0, which is a different answer to a different question.
Free drills are open with no account. Premium drills show the problem to everyone and grade the sheet for subscribers.
AND is multiplication of the tests. OR is addition of the tests. (A2:A5="East")*(B2:B5="Pen") keeps East Pens. (B2:B5="Pen")+(B2:B5="Book") keeps either product. Do not add tests that can both be true for one row unless you want that row once for each hit. Use parentheses.
Yes. The array can be A2:C5, and the include test still has one value per row. The spill is then as wide as the array. SUM of that spill would add text as well as numbers, so sum a single amount column when the total is the goal.
Copy the headers you want to test into a blank area. Type the required values on the row under those headers. East under Region and Pen under Product, same row, means both. A second row of criteria is another acceptable combination.
The East sales drill grades one cell. SUM collapses the spill into the total 60, which is the figure the drill checks. The matching amounts are still what FILTER selected.