Templates, guides & honest tool reviews for small business

Sunday, November 29, 2026

XLOOKUP with Multiple Criteria in Excel: Two Working Formulas

XLOOKUP with multiple criteria in Excel
Illustration: XLOOKUP with multiple criteria in Excel

To use XLOOKUP with multiple criteria in Excel, multiply two or more tests inside the lookup value and look for 1: =XLOOKUP(1, (A2:A100=G1)*(B2:B100=H1), C2:C100, "Not found"). Each test returns TRUE or FALSE, and multiplying them gives 1 only on rows where all tests are true. XLOOKUP is available in Excel 365 and Excel 2021 or later. This guide shows the formula step by step, a version that joins columns, how to return several columns, and how to fix #N/A and #VALUE! errors. The sample data is made up.

The problem

XLOOKUP, like VLOOKUP, looks for one value in one column. If your table has the same customer on several rows with different products, a lookup on the customer alone returns the first row only. You need to match customer and product together.

Method 1: multiply the conditions

With customers in A, products in B and prices in C, and the customer name in G1 and the product in H1:

=XLOOKUP(1, (A2:A100=G1)*(B2:B100=H1), C2:C100, "Not found")

Here is what happens. (A2:A100=G1) is a list of TRUE and FALSE values. Multiplying by (B2:B100=H1) turns them into 1 and 0, with 1 only where both match. XLOOKUP then searches that list for the first 1 and returns the price from the same row.

XLOOKUP multiple criteria by multiplying conditions in Excel
Made-up orders (illustration).

Method 2: join the columns

You can also join the lookup columns with a separator and look up joined text:

=XLOOKUP(G1 & "|" & H1, A2:A100 & "|" & B2:B100, C2:C100, "Not found")

The separator keeps "AB" plus "C" different from "A" plus "BC". This is easy to read and works with text. Method 1 is better for numbers and dates because it does not turn them into text.

XLOOKUP with multiple criteria by joining columns
A separator keeps keys distinct (illustration).

Three or more conditions

Keep multiplying. To add a region test in column D, with the region in I1:

=XLOOKUP(1, (A2:A100=G1)*(B2:B100=H1)*(D2:D100=I1), C2:C100, "Not found")

Conditions that are not equal to

You can use any comparison inside the brackets. To find the first row for a customer where the quantity is above 10, with quantities in E: (A2:A100=G1)*(E2:E100>10).

Return several columns at once

Give XLOOKUP a return range with more than one column and it spills across:

=XLOOKUP(1, (A2:A100=G1)*(B2:B100=H1), C2:E100, "Not found")

That returns columns C to E for the matching row. Make sure the cells to the right are empty, or you get a #SPILL! error. Our guide to the #SPILL! error explains the fix.

Get the last match instead of the first

Set the search mode to -1 to search from the bottom: =XLOOKUP(1, (A2:A100=G1)*(B2:B100=H1), C2:C100, "Not found", 0, -1). This gives the most recent row if your data is sorted by date.

XLOOKUP returning several columns or the last match in Excel
Search mode -1 starts from the bottom (illustration).

Return all matches

XLOOKUP returns one row. To list every match, use FILTER: =FILTER(C2:C100, (A2:A100=G1)*(B2:B100=H1)). See the FILTER function guide.

In older versions of Excel

If you do not have XLOOKUP, use INDEX and MATCH with the same multiplication, or add a helper column with the joined key and use VLOOKUP. The two main functions are compared in XLOOKUP vs VLOOKUP, and the basics are in the XLOOKUP guide.

Fix XLOOKUP multiple criteria errors in Excel
Common causes (illustration).

Fix common errors

  • #N/A or "Not found". No row matched. Check spaces and spelling, and use TRIM on the data if needed.
  • #VALUE! The ranges have different sizes. Each range must have the same number of rows.
  • Wrong row returned. Two rows match, and XLOOKUP returns the first. Use search mode -1 or FILTER.
  • #NAME? Your Excel version does not have XLOOKUP.

Questions and answers

Why do I look up the number 1?

Multiplying TRUE and FALSE values gives 1 or 0. The row where all conditions are true is the first 1.

Does this need Ctrl+Shift+Enter?

Not in Excel 365 or Excel 2021. Older versions that lack XLOOKUP would need it for the INDEX and MATCH version.

Can I use OR instead of AND?

Use addition instead of multiplication. (A2:A100=G1)+(B2:B100=H1) is above 0 when either test is true. XLOOKUP matches exact values, so for OR logic use FILTER with that sum.

Does it work in Google Sheets?

Google Sheets has XLOOKUP too, and the array approach may need ARRAYFORMULA. Test it, or use the methods in our Google Sheets guide.

العربية