XLOOKUP with multiple criteria

Sometimes a single lookup value is not enough. A price depends on the item and the size, a sales figure on the person and the month. XLOOKUP can match several criteria at once, no helper column required.

In short: =XLOOKUP(E2&F2,A2:A9&B2:B9,C2:C9) matches item and size together. For any number of conditions, including comparisons, use =XLOOKUP(1,(A2:A9=E2)*(B2:B9=F2),C2:C9).

Try it now

The notepad comes in three sizes and each has its own price. A plain XLOOKUP on the item name stops at the first notepad in the list, which is the wrong size.

Task The notepad comes in several sizes. In G2, use XLOOKUP to find the price of the item in E2 in the size given in F2.

ABCDEFG
1 Item Size Price $ Item Size Price
2 Notepad A5 1.9 Notepad A4
3 Binder A4 3.49
4 Clipboard A4 4.2
5 Notepad A4 2.6
6 Binder A5 2.99
7 Notepad A6 1.2
8 Clipboard A5 3.1
9 Spiral pad A4 3.8

Method 1: join the lookup values and the lookup arrays

This is the classic answer to "XLOOKUP with two criteria". Glue the lookup values together with & and glue the lookup columns together the same way. Excel then builds one combined key per row and compares it with yours.

ArgumentWhat goes inIn the example
lookup_valueBoth lookup values joinedE2&F2 becomes "NotepadA4"
lookup_arrayBoth lookup columns joined row by rowA2:A9&B2:B9 becomes "NotepadA5", "BinderA4" and so on
return_arrayThe column holding the answerC2:C9
if_not_found (optional)Text to show when no row matches"not found"

A third criterion just extends both chains: =XLOOKUP(F2&G2&H2,A2:A9&B2:B9&C2:C9,D2:D9). Keep the order identical on both sides.

Add a delimiter to avoid false matches

Joined keys can collide now and then: "AB" plus "C" gives the same key as "A" plus "BC". If your data could look like that, put a character between the parts that never appears in the data: =XLOOKUP(E2&"|"&F2,A2:A9&"|"&B2:B9,C2:C9).

Method 2: multiply conditions and look up 1

The boolean method looks odd the first time, but it is the more flexible one. Each condition in brackets produces TRUE or FALSE for every row. When you multiply the conditions, Excel treats TRUE as 1 and FALSE as 0, so only a row where every condition holds ends up as 1. XLOOKUP then searches for that 1.

=XLOOKUP(1,(A2:A9=F2)*(B2:B9=G2)*(C2:C9=H2),D2:D9)

Because each condition is an ordinary comparison, you are not limited to "equals". Something like (D2:D9>=1000) or a date window with two conditions works fine, which the join method cannot do. Try it with three criteria:

Task Three criteria: in I2, return the sales for the region in F2, the product in G2 and the quarter in H2. Use the method with 1 and multiplied conditions.

ABCDEFGHI
1 Region Product Quarter Sales $ Region Product Quarter Sales
2 South Toner Q2 2350 North Toner Q2
3 North Paper Q1 1800
4 North Toner Q2 2900
5 South Paper Q1 1450
6 North Paper Q2 2050
7 South Toner Q1 2600
8 North Toner Q1 3100
9 South Paper Q2 1700

When the combination does not exist

If no row satisfies every condition, XLOOKUP returns #N/A. The fourth argument handles that for both methods, so there is no need to wrap the formula in IFERROR.

Task In G2, return the sales of the person in E2 for the month in F2. March is still missing for Lena Hoffmann. If the combination does not exist, G2 should show “not found” instead of #N/A.

ABCDEFG
1 Name Month Sales $ Name Month Sales
2 Murat Kaya February 4200 Lena Hoffmann March
3 Jana Weber January 3850
4 Lena Hoffmann February 5100
5 Murat Kaya January 3900
6 Jana Weber March 4600
7 Lena Hoffmann January 4450
8 Murat Kaya March 4750
9 Jana Weber February 3700

Which method should you use?

Join with &Multiply and look up 1
Readabilityshort and easy to followa little longer
Only "equals"yesno, also >, < and date ranges
Number vs textno problem, & turns everything into text5 and "5" do not match
Risk of false matchesrare, avoidable with a delimiternone

Common mistakes

#VALUE! instead of a result

All ranges must have the same size. Mixing A2:A9&B2:B10, or pairing them with a return array of C2:C8, gives #VALUE!.

#N/A although the row is clearly there

The usual suspects are a trailing space or a number stored as text. TRIM removes the spaces, see SUBSTITUTE and TRIM. With the boolean method, also check that the lookup value and the column are both real numbers.

Several rows match

XLOOKUP returns the first match from the top. For the last one, set search_mode to -1: =XLOOKUP(E2&F2,A2:A9&B2:B9,C2:C9,"not found",0,-1). If you need every match or their total, FILTER or SUMIFS is the better tool.

Whole columns slow the file down

A:A&B:B joins more than a million rows on every recalculation. Use fixed ranges or an Excel table (Ctrl+T), whose ranges grow with the data.

XLOOKUP with multiple criteria in German Excel

German Excel calls the function XVERWEIS and separates arguments with semicolons. The & operator and the multiplication stay exactly the same.

EnglishGerman
=XLOOKUP(E2&F2,A2:A9&B2:B9,C2:C9)=XVERWEIS(E2&F2;A2:A9&B2:B9;C2:C9)
=XLOOKUP(1,(A2:A9=E2)*(B2:B9=F2),C2:C9)=XVERWEIS(1;(A2:A9=E2)*(B2:B9=F2);C2:C9)

Which Excel versions support this?

XLOOKUP is available in Microsoft 365, Excel 2021 and Excel 2024. Excel 2019 and older do not have it and show #NAME?. In every version that has XLOOKUP, both methods work as normal formulas without Ctrl+Shift+Enter, because those versions support dynamic arrays.

For older versions, use =INDEX(C2:C9,MATCH(1,(A2:A9=E2)*(B2:B9=F2),0)) and in Excel 2019 and earlier confirm it as a legacy array formula with Ctrl+Shift+Enter. The helper column approach is covered in VLOOKUP with multiple criteria, and the basics of the function in XLOOKUP.

FAQ

How many criteria can XLOOKUP handle?

As many as you need with either method. Add another value and column with &, or add another bracketed condition to the multiplication.

Do I need a helper column?

No. VLOOKUP needed one because it only searches a single column. XLOOKUP builds the combined key inside the formula.

Can one criterion be "greater than" or a date range?

Yes, with the boolean method. For example =XLOOKUP(1,(A2:A9=E2)*(B2:B9>=F2)*(B2:B9<=G2),C2:C9) finds a row for the person in E2 with a date between F2 and G2.

Can XLOOKUP return several columns at once?

Yes. Give it a return array that spans several columns, such as C2:D9, and the result spills into the cells to the right.

Learn this next: INDEX and MATCH

The pair works in every Excel version, looks in any direction and handles multiple criteria too.

Practice INDEX and MATCH

Write to us