XLOOKUP Multiple Criteria — With Examples (Boolean Logic, Concatenation, OR)
Learn XLOOKUP with multiple criteria in Excel: Boolean logic, concatenation, helper columns and OR logic, with worked examples.
Read Guide →You have a list of orders and you only want the East ones — or the ones above $1,000 — and every time the list changes you filter it again by hand. The FILTER function does this once, with a formula: you type it in one cell, Excel pulls out every matching row into a new list, and when the data changes the list updates itself. It is not the same as the Filter button on the Data tab — that button only hides rows on the same sheet, while FILTER builds a live, separate list you can use anywhere. This guide gives you the formula first, works it through on a small sales table you can check by hand, shows you the one trick for two conditions, and fixes the two errors that catch everyone, #CALC! and #SPILL!.
Quick takeaway: FILTER builds a live list of matching rows.
=FILTER(array, include, [if_empty])array is the data, include is the test (TRUE/FALSE) for each row.AND() does not work inside FILTER.
Both are called “filter”, and they do different jobs.
| Filter button (AutoFilter) | FILTER function | |
|---|---|---|
| What it does | Hides rows on the same sheet | Builds a new, separate list of matching rows |
| Updates when data changes | You re-filter by hand | Automatically — it is a formula |
| The result | A view of the same table | A live list you can use in other formulas |
| Where it lives | Data tab → Filter | A formula in a cell |
| Works in old Excel | Yes, every version | No — Microsoft 365, 2021, 2024 only |
Use the Filter button when you just want to look at part of a list. Use the FILTER function when you want a separate list that stays up to date — for a report, a dashboard, or another formula. This article is about the function.
The FILTER function returns every row of a range that meets one or more conditions, as a dynamic array — a result that spills into the cells below and to the right automatically, and updates when the source data or the conditions change.
=FILTER(array, include, [if_empty])
B2:B7="East". FILTER keeps only the rows where the test is TRUE.The worked examples below use one small sales table, so you can check every result by hand.
| Order | Region | Item | Amount |
|---|---|---|---|
| 101 | East | Chairs | 1200 |
| 102 | West | Lamps | 800 |
| 103 | East | Tables | 1500 |
| 104 | West | Chairs | 400 |
| 105 | East | Lamps | 950 |
| 106 | West | Tables | 2100 |
The table sits in A1:D7 (headers in row 1, data in rows 2 to 7).
=FILTER( and then the range to filter, for example A2:D7.B2:B7="East".Example: =FILTER(A2:D7, B2:B7="East") returns 3 rows — orders 101, 103 and 105. Check it: those are the only rows with East in column B.
Filter the amounts above $1,000:
=FILTER(D2:D7, D2:D7>1000)
Result: 1200, 1500, 2100. Check it: the amounts are 1200, 800, 1500, 400, 950, 2100 — only 1200, 1500 and 2100 are above 1,000.
Filter the whole rows where the item is Chairs:
=FILTER(A2:D7, C2:C7="Chairs")
Result: orders 101 and 104. Check it: Chairs appears in rows 2 and 5 of the data.
FILTER has only one include argument, so two conditions go into a single test. The trick is arithmetic, not AND() or OR():
*. TRUE is 1 and FALSE is 0, so the product is 1 only when both are true.+. The sum is 1 or more when at least one is true.Put each condition in its own brackets. Leaving the brackets out is the most common cause of wrong results.
AND — East orders above $1,000:
=FILTER(A2:D7, (B2:B7="East")*(D2:D7>1000))
Result: orders 101 and 103. Check it: East rows are 101 (1200), 103 (1500) and 105 (950). Of those, only 101 and 103 are above 1,000 — 105 is 950, so it drops out.
OR — Chairs or Lamps:
=FILTER(A2:D7, (C2:C7="Chairs")+(C2:C7="Lamps"))
Result: orders 101, 102, 104 and 105. Check it: Chairs are 101 and 104, Lamps are 102 and 105 — four rows in total, and the two Tables orders (103, 106) are left out.
Do not use AND() or OR() inside FILTER — they collapse the whole test into a single TRUE or FALSE instead of one value per row, and the formula breaks. The * and + trick is the whole method.
If no rows meet the test and you left out if_empty, FILTER shows a #CALC! error. That is not a bug — it is Excel telling you the list is empty.
=FILTER(A2:D7, B2:B7="North", "No orders found")
Result: “No orders found” — there are no North rows in the table, so the message appears instead of #CALC!.
Use if_empty for a friendly message, or for a fallback: =FILTER(MasterList, MasterList[Region]=$H$2, MasterList) returns the whole table when the dropdown in H2 is blank, instead of an error. That is the pattern to use for a dropdown-driven filter (below).
Put the region in a cell — say H2 — and point the test at it:
=FILTER(A2:D7, B2:B7=$H$2)
Change H2 from East to West and the list changes with it. Add the if_empty fallback so a blank H2 shows the whole table instead of #CALC!:
=FILTER(A2:D7, B2:B7=$H$2, A2:D7)
And to sort the result by amount, largest first, wrap it in SORT:
=SORT(FILTER(A2:D7, B2:B7="East"), 4, -1)
Result: order 103 (1500), 101 (1200), 105 (950). The 4 means “sort by the 4th column” (Amount), and −1 means largest first.
Because FILTER returns a live list, you can feed it straight into another function. To add up the amounts of all Chairs and Lamps orders:
=SUM(FILTER(D2:D7, (C2:C7="Chairs")+(C2:C7="Lamps")))
Result: 3350. Check it: 1200 + 800 + 400 + 950 = 3350. The same idea works with AVERAGE, COUNT and MAX — FILTER first, then the function that does the maths. For the building blocks, see the SUM formula guide.
| Mistake | What happens | Fix |
|---|---|---|
| You used the Filter button and expected a live list | The rows are hidden, not copied — nothing updates | Use the FILTER function for a live list |
| You dragged the formula down | Every copy spills and they block each other — #SPILL! | Type it once, in the top-left cell only |
| Something is in the way below the formula | #SPILL! — Excel has nowhere to put the results | Clear the cells below and to the right |
| Nothing matches and you left out if_empty | #CALC! error | Add if_empty: =FILTER(A2:D7, B2:B7="North", "No orders found") |
| You used AND() or OR() inside FILTER | The test collapses to one value and the formula breaks | Use * for AND, + for OR, with brackets around each test |
| You left out the brackets around a condition | The maths applies in the wrong order and rows are wrong | Bracket each test: (B2:B7="East")*(D2:D7>1000) |
| Your test range is a different size from your data | #VALUE! — the test must match the data row for row | Make include the same height as array |
| You have Excel 2019 or earlier | #NAME? — FILTER does not exist in your version | Use Advanced Filter, or an INDEX/SMALL array formula |
| You typed the region with a different spelling | No rows match — “east” is not “East” to Excel | Match the text exactly, or use UPPER/LOWER on both sides |
What is the FILTER function in Excel? =FILTER(array, include, [if_empty]). It returns every row of a range that meets your test, as a live list that spills below the formula cell and updates when the data changes.
How do I filter data in Excel with a formula? Use =FILTER(A2:D7, B2:B7="East") — the first part is the data, the second part is the test. Type it once and Excel spills the matching rows.
How do I use FILTER with multiple criteria in Excel? Put each condition in brackets and join them: * for AND, + for OR. Example: =FILTER(A2:D7, (B2:B7="East")*(D2:D7>1000)) for East AND above $1,000.
What is the difference between FILTER and the Filter button? The Filter button hides rows on the same sheet. FILTER builds a separate, live list that updates automatically and can feed other formulas.
Why does FILTER show #CALC!? No rows matched your test and you left out if_empty. Add it: =FILTER(A2:D7, B2:B7="North", "No orders found").
Why does FILTER show #SPILL!? Something is blocking the cells where the results should go — either data in the way, or a copied formula below. Clear the cells under the formula, and type the formula only once.
Does FILTER work in Excel 2019? No. FILTER needs Microsoft 365, Excel 2021 or Excel 2024 (or Excel for the web). In 2019 or earlier it shows #NAME?. Use Advanced Filter or an INDEX/SMALL array formula instead.
How do I filter by a dropdown in Excel? Point the test at the dropdown cell: =FILTER(A2:D7, B2:B7=$H$2). Add if_empty so a blank dropdown shows the whole table instead of #CALC!.
That is the whole method: the data, one test per row, and the brackets-and-arithmetic trick for two conditions — * for AND, + for OR. It works for one condition or many, for a dropdown-driven list, and inside SUM and AVERAGE, and the only cases that need extra care are a blocked spill range and a version of Excel that does not have the function. Try it on your own list now, with the sales table above, and when you need to look up a single value instead of a whole list, the next guides to read are the XLOOKUP vs VLOOKUP guide and the VLOOKUP formula guide — FILTER pulls out every match, while a lookup pulls out one.
Learn XLOOKUP with multiple criteria in Excel: Boolean logic, concatenation, helper columns and OR logic, with worked examples.
Read Guide →Learn the MATCH function in Excel: exact and approximate matches, wildcards, INDEX MATCH lookups, two-way lookups and XMATCH.
Read Guide →Learn the UNIQUE function in Excel: distinct values from a column, exactly once, sorted, blank-free, counted and combined.
Read Guide →