How to Use XLOOKUP with Multiple Criteria (2 Easy Methods)

XLOOKUP with multiple criteria tutorial cover
Image: Spreadsheet Tutorials & Productivity (original graphic)

XLOOKUP is great at finding a value based on one condition. But real data rarely works that way. You often need the sales figure for a specific region, product and month at the same time. In this tutorial you will learn two reliable ways to use XLOOKUP with multiple criteria, without adding a helper column.

Quick answer: =XLOOKUP(1, (range1=value1)*(range2=value2), return_range, "Not found")

The example data

We will use a small sales table. Columns A to D hold the data, and cells G2:G4 hold the three things we want to match: region, product and month.

Excel sheet showing XLOOKUP with three criteria returning 10,450
XLOOKUP matching West + Laptop + Feb. Image: Spreadsheet Tutorials & Productivity (original screenshot)
A: RegionB: ProductC: MonthD: Sales
2EastLaptopJan12,500
3WestLaptopJan9,800
4EastMonitorJan4,200
5WestMonitorJan3,900
6EastLaptopFeb13,100
7WestLaptopFeb10,450
8EastMonitorFeb4,600
9WestMonitorFeb4,150

Method 1: Multiply the conditions (recommended)

Enter this formula in G6:

=XLOOKUP(1,(A2:A9=G2)*(B2:B9=G3)*(C2:C9=G4),D2:D9,"Not found")

With West, Laptop and Feb in G2:G4, the result is 10,450, the value in row 7.

How it works

  1. (A2:A9=G2) compares every region with "West" and returns a list of TRUE/FALSE values.
  2. The same happens for product and month.
  3. Multiplying the three lists turns TRUE into 1 and FALSE into 0. A row only gets a 1 if all conditions are true; otherwise it gets 0.
  4. XLOOKUP then searches that list for the number 1 and returns the matching value from D2:D9.

The multiplication sign works like AND. Do not use the AND() function here: it collapses everything into a single TRUE or FALSE instead of checking row by row.

XLOOKUP returns the first match

If more than one row meets your criteria, XLOOKUP returns the first one it finds. For example, with only two criteria (West + Laptop), the formula returns 9,800 from January, because row 3 comes before row 7. To get the last match instead, set the sixth argument (search mode) to -1:

=XLOOKUP(1,(A2:A9=G2)*(B2:B9=G3),D2:D9,"Not found",0,-1)

Method 2: Join the criteria together

The second approach combines the criteria into one text string and looks it up in a combined version of the columns:

=XLOOKUP(G2&"|"&G3&"|"&G4,A2:A9&"|"&B2:B9&"|"&C2:C9,D2:D9,"Not found")

This also returns 10,450. The | separator is important. Without it, different combinations can produce the same text (for example "AB" + "C" and "A" + "BC" both become "ABC") and return the wrong row.

Method 1 is usually the better choice because it also works with numbers, dates and comparisons such as (D2:D9>5000). Method 2 is handy when you find it easier to read.

What if no row matches?

The fourth argument, "Not found", is what XLOOKUP shows when there is no match. If you change G2 to "North" (a region that does not exist in the table), the formula returns Not found instead of an #N/A error.

Older Excel versions: INDEX and MATCH

XLOOKUP is available in Excel for Microsoft 365, Excel 2021, Excel 2024 and Excel for the web. In Excel 2019 and earlier, use INDEX with MATCH and the same multiplication trick:

=INDEX(D2:D9,MATCH(1,(A2:A9=G2)*(B2:B9=G3)*(C2:C9=G4),0))

In those older versions, confirm the formula with Ctrl + Shift + Enter so Excel treats it as an array formula.

Google Sheets

Google Sheets also has XLOOKUP, and Method 1 uses the same structure. If you want every matching row rather than just the first, use FILTER instead:

=FILTER(D2:D9,(A2:A9=G2)*(B2:B9=G3)*(C2:C9=G4))

Common mistakes

  • Ranges of different sizes. All ranges (A2:A9, B2:B9, C2:C9, D2:D9) must have the same number of rows, or you will get a #VALUE! error.
  • Hidden spaces. "West " with a trailing space is not the same as "West". Clean your data with TRIM if matches fail unexpectedly.
  • Numbers stored as text. A month number typed as text ("2") will not match the number 2.
  • Looking up TRUE instead of 1. After multiplying, the list contains 1s and 0s, so the lookup value must be 1.

Frequently asked questions

Can XLOOKUP return more than one result?

No. XLOOKUP returns one match per formula (the first or the last). Use FILTER to return all matching rows.

Is XLOOKUP case-sensitive?

No. To make one condition case-sensitive, replace it with EXACT, for example EXACT(A2:A9,G2)*(B2:B9=G3).

How many criteria can I use?

As many as you need. Just add another *(range=value) block for each extra condition.

Summary

To use XLOOKUP with multiple criteria, multiply each condition together and look up the number 1. It is fast, needs no helper column, and works with any number of conditions. Next, learn how to fix #N/A errors when a lookup does not find what you expect.

Komentar