Tabellab
Excel formulas

FILTER function in Excel with multiple criteria: AND, OR and both

The FILTER function has only one include argument, so you combine several criteria into one logical array: multiply the conditions for AND, add them for OR. =FILTER(A2:E11,(B2:B11="East")*(E2:E11>=1000)) returns every East order of at least 1,000 and spills the matching rows below the formula. In the worked example below that is 3 orders worth 6,440. This guide shows AND, OR, both together, the "if empty" message and how to sort and total the result.

Updated 21 Oct 2026 5 min read By Tabellab team

The FILTER syntax

=FILTER(array, include, [if_empty])

  • array: the rows you want back, one column or the whole table.
  • include: an array of TRUE/FALSE with the same number of rows, usually a comparison such as B2:B11="East".
  • if_empty (optional): what to show when no row matches. Without it, FILTER returns #CALC!.

The result is a dynamic array: you type the formula in one cell and Excel spills the matching rows into the cells below and to the right. FILTER is available in Microsoft 365, Excel 2021 and later and Excel for the web. Put the criteria in cells (E13 to E15 in the example) instead of typing them into the formula, so the extract updates when someone changes a criterion.

AND: multiply the conditions

For orders from the East region and with an amount of at least 1,000:

=FILTER(A2:E11,(B2:B11=E13)*(E2:E11>=E14),"No orders")

Each condition returns ten TRUE/FALSE values. Multiplying them turns TRUE into 1 and FALSE into 0, and a row only keeps a 1 if both conditions are true, because 1 × 1 = 1 while anything times 0 is 0. FILTER keeps the rows with a 1: SO-1001 (1,240), SO-1003 (2,150) and SO-1008 (3,050), a total of 6,440. Add a third condition with another *( … ). The brackets around each condition are required, because without them Excel multiplies before it compares.

Worked example: ten orders, one criteria block, FILTER with AND and OR

Rows 2 to 11 are the data and E13 to E15 the criteria. Change a criterion in your own copy and every result updates. Hover over a green cell to see its formula.

Worked example: ten orders, one criteria block, FILTER with AND and OR
ABCDE
1OrderRegionChannelRepAmount
2SO-1001EastOnlineKim1,240
3SO-1002WestRetailDiaz860
4SO-1003EastRetailKim2,150
5SO-1004NorthOnlinePatel640
6SO-1005EastOnlineLee480
7SO-1006WestOnlineDiaz1,730
8SO-1007SouthRetailPatel1,120
9SO-1008EastOnlineLee3,050
10SO-1009NorthRetailKim920
11SO-1010WestOnlineDiaz1,380
12
13Criteria: regionEast
14Criteria: minimum amount1,000
15Criteria: channelOnline
16
17AND: region = E13 and amount ≥ E14 (the spilled orders)Result
181st matching orderSO-1001
192nd matching orderSO-1003
203rd matching orderSO-1008
21Number of matches3
22Total amount of the matches6,440
23Largest match first: order at the top of SORT(FILTER())SO-1008
24OR and combined criteriaResult
25OR: region = E13 or channel = E15, number of orders7
26OR: total amount10,670
27(East or West) and Online, number of orders5
28(East or West) and Online, total amount7,880
29Amount between 500 and 1,500, number of orders6
30No match: region Central, with an if_empty messageNo orders
Key formulas
  • E18=INDEX(FILTER($A$2:$A$11,($B$2:$B$11=$E$13)*($E$2:$E$11>=$E$14)),1)AND: first spilled order
  • E22=SUM(FILTER($E$2:$E$11,($B$2:$B$11=$E$13)*($E$2:$E$11>=$E$14)))Total of the AND matches
  • E25=ROWS(FILTER($A$2:$A$11,($B$2:$B$11=$E$13)+($C$2:$C$11=$E$15)))OR: add the conditions
  • E27=ROWS(FILTER($A$2:$A$11,(($B$2:$B$11="East")+($B$2:$B$11="West"))*($C$2:$C$11=$E$15)))OR group inside AND
  • E30=FILTER($A$2:$A$11,$B$2:$B$11="Central","No orders")if_empty message

Fictional orders. In Excel, a single =FILTER(…) in E18 spills all matches at once; the grid uses INDEX(FILTER(…),k) so each spilled value can be shown and checked in its own cell.

OR: add the conditions

For orders that are from the East or sold online:

=FILTER(A2:E11,(B2:B11=E13)+(C2:C11=E15))

Adding the two arrays gives 0 when neither condition is true, 1 when one is and 2 when both are. FILTER treats every number other than 0 as TRUE, so an online order from the East (2) appears once, not twice. The result is 7 orders with a total of 10,670.

AND and OR together

Online orders from the East or the West need an OR group inside an AND:

=FILTER(A2:E11,((B2:B11="East")+(B2:B11="West"))*(C2:C11=E15))

The extra pair of brackets around the OR group decides the order of the calculation, exactly like (a + b) × c in arithmetic. The formula returns 5 orders worth 7,880. With a longer list of allowed values, keep them in a range and test membership instead: ISNUMBER(MATCH(B2:B11,G2:G5,0))*(C2:C11=E15). A range of values works the same way, two conditions on one column multiplied: (E2:E11>=500)*(E2:E11<=1500) finds the 6 orders between 500 and 1,500.

Why AND() and OR() do not work inside FILTER

=FILTER(A2:E11,AND(B2:B11="East",E2:E11>=1000)) looks logical but fails. AND and OR collapse a whole array into one single TRUE or FALSE, so FILTER no longer gets one answer per row and returns an error. The same is true in SUMPRODUCT and other array formulas, which is why * and + are the standard way to write multiple criteria.

No match, sorting, counting and totals

  • No match: there are no orders from the Central region yet, so =FILTER(A2:A11,B2:B11="Central","No orders") shows No orders instead of #CALC!. Use "" for an empty cell.
  • Sorted: wrap the result in SORT. =SORT(FILTER(A2:E11,(B2:B11=E13)*(E2:E11>=E14)),5,-1) sorts the matches by column 5, the amount, largest first, so SO-1008 comes to the top.
  • Count and total: =ROWS(FILTER(…)) counts the matching rows and =SUM(FILTER(E2:E11,…)) totals them. For a total alone, SUMIFS is shorter, but the FILTER version also works for OR logic.

How the example shows the spilled result

In Excel you would type =FILTER(A2:A11,(B2:B11=E13)*(E2:E11>=E14)) once in E18 and the three order numbers would spill into E18:E20. The example grid on this page shows every value in its own checked cell, so E18 to E20 use =INDEX(FILTER(…),k), which picks the k-th row of the same spilled result. The values are identical. If you need a version for Excel 2019 or older, which has no FILTER, a k-th match helper with INDEX and a running COUNTIF does the same job, as in the guide on INDEX MATCH with multiple criteria.

Common mistakes

  • Missing brackets around each condition. B2:B11=E13*E2:E11>=E14 multiplies first and compares later. Write (B2:B11=E13)*(E2:E11>=E14).
  • Using AND() or OR(). They return one single value for the whole range, so FILTER fails. Use * for AND and + for OR.
  • Ranges of different heights. The include array must have exactly as many rows as the array, otherwise FILTER returns #VALUE!.
  • Cells in the way of the spill. Anything typed below or beside the formula blocks the result and shows #SPILL!. Leave room for the largest possible result.
  • No if_empty argument. When nothing matches, FILTER returns #CALC!, which breaks totals that refer to it. Add a message such as "No orders".
  • Text that only looks the same. "East " with a trailing space or amounts stored as text do not match. Clean the data with TRIM and VALUE first.

Frequently asked questions

Can the FILTER function use multiple criteria?

Yes. FILTER has one include argument, so you combine the criteria inside it: multiply the conditions for AND, for example (B2:B11="East")*(E2:E11>=1000), and add them for OR. You can combine as many conditions as you need.

How do I use FILTER with OR in Excel?

Add the conditions: =FILTER(A2:E11,(B2:B11="East")+(C2:C11="Online")). A row is returned when at least one condition is true. Rows that meet both conditions still appear only once.

Why does FILTER return #CALC!?

#CALC! means no row matched, so the result would be an empty array. Add the third argument, for example "No orders" or "", to show a message or an empty cell instead.

Does FILTER work in Excel 2016 or 2019?

No. FILTER needs Microsoft 365, Excel 2021 or later, or Excel for the web. In older versions use AutoFilter or Advanced Filter, or a formula with INDEX and a k-th match helper column.

Practise it in a lab

Related guides

Reading is step one. Doing is step two.

Every guide links to a lab where you build the same calculation in an online spreadsheet and get instant feedback.

Open the lab