What FILTER does

FILTER returns the rows of a range that meet a condition, as a list that fills the cells below the formula. =FILTER(B2:C7,A2:A7="West") lists every order from the West region with its amount, and the list changes by itself when the data does.

The test runs on every row of the column you give it, and each row gets a TRUE or a FALSE. FILTER keeps the TRUE rows, in the order they appear, and leaves the source list as it is. The filter buttons on the Data tab hide rows in the list itself; FILTER puts a second copy of the matching rows wherever you write the formula, such as on a summary sheet.

The result spills: the formula sits in one cell and its results fill as many cells below and to the right as they need. If a cell in that space isn’t empty, the formula shows #SPILL! until you clear it.

Syntax

=FILTER(array, include, [if_empty])
Arguments in square brackets are optional; the rest are required.
arrayRequired
The rows to return, such as B2:C7. FILTER returns every column of this range, so give it just the columns you want back.
includeRequired
The test, written over a whole column so it gives TRUE or FALSE for every row, such as A2:A7="West". It must cover the same rows as array. Join two tests with * when both must pass and with + when either will do.
if_emptyOptional
What to show when no row passes, such as "No orders", or "" for an empty-looking cell. Without it, a filter that matches nothing shows #CALC!.

Example: every order from one region

The region to list is typed in B9. The formula in B12 returns that region’s orders with their amounts, under headings typed in row 11.

Rows 2, 4 and 6 are in the West, so their orders and amounts come through, in the order they appear. In B12, =FILTER(B2:C7,A2:A7=B9,"No orders") returns SO-1041.

Read it as: from B2:C7, keep the rows where A2:A7 matches the region in B9. The array starts at column B, so the region column stays out of the result. Type East in B9 and the list changes to SO-1042 and SO-1046.

FILTER with multiple criteria

Each test gives TRUE or FALSE for every row, and arithmetic turns TRUE into 1 and FALSE into 0. Multiply two tests when a row must pass both: the product is 1 only when both are TRUE. Put each test in its own brackets.

SO-1045 is in the West, but its 415 fails the second test, so it's left out. In B10, =FILTER(B2:C7,(A2:A7="West")*(C2:C7>1000),"None") returns SO-1041.

For rows that pass either test, add the tests instead. =FILTER(B2:C7,(A2:A7="West")+(A2:A7="North")) lists the four orders from the West or the North: a row that passes one test adds up to 1, and FILTER keeps any row that isn’t 0.

The AND and OR functions don’t work here. They return one TRUE or FALSE for the whole range, where FILTER needs one for every row, so the formula shows #VALUE!.

When FILTER finds nothing

If no row passes the test, FILTER has nothing to return and shows #CALC!. The third argument gives it something to show instead: =FILTER(B2:C7,A2:A7="South","No orders") shows No orders, because none of the orders are in the South. Use "" when the cell should simply look empty.

Common mistakes

  • =FILTER(B2:C7,A2:A6="West") shows #VALUE!, because the test covers five rows and the array six. Start and end both ranges on the same rows.
  • =FILTER(B2:C7,AND(A2:A7="West",C2:C7>1000)) shows #VALUE! too. Multiply the tests, each in brackets, instead of using AND.
  • A note or a number typed anywhere in the space the result needs blocks all of it, and the formula shows #SPILL!. Clear those cells or move the formula.
  • FILTER can’t spill inside an Excel table, where it shows #SPILL!. Write it in an ordinary range beside or below the table.
  • Typing the value into the test, as in A2:A7="West", means editing the formula for every new region. Point the test at a cell, as with B9 above.
  • FILTER isn’t in Excel 2019 or earlier, where the formula shows #NAME?. There, use the filter buttons on the Data tab, or Advanced Filter to copy the matching rows somewhere else.

Frequently asked questions

How do I use FILTER with multiple criteria?

Multiply the tests, each in brackets: =FILTER(B2:C7,(A2:A7="West")*(C2:C7>1000)) returns the rows that are in the West and over 1,000. Add a third bracket for a third condition.

How do I use FILTER with OR conditions?

Add the tests instead of multiplying them: =FILTER(B2:C7,(A2:A7="West")+(A2:A7="North")) returns the rows from either region.

Why does FILTER return #CALC!?

No row passed the test, and FILTER can’t return an empty list. Give the third argument, such as "None" or "", to show instead of the error.

Can FILTER return only certain columns?

It returns every column of the array you give it, so start and end the array at the columns you want, which works when they sit side by side. For columns apart from each other, write one FILTER for each column with the same test.

Does FILTER update automatically?

Yes. When a value in the ranges changes, the list changes with it. Rows typed below the ranges are left out, so point FILTER at an Excel table, as in =FILTER(Sales,Sales[Region]="West"), if the list keeps growing.

Which versions of Excel have FILTER?

Microsoft 365, Excel for the web, and Excel 2021 or later. Excel 2019 and earlier don’t have it.