ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. XLOOKUP With Multiple Criteria

XLOOKUP With Multiple Criteria

By ExcelReady Team·Updated November 2, 2026·6 min read

The short answer

XLOOKUP has no separate argument for a second condition, so you combine the criteria yourself. Either join them: =XLOOKUP(G2&"|"&H2,A2:A8&"|"&B2:B8,C2:C8), or multiply tests and look up 1: =XLOOKUP(1,(A2:A8=G2)*(B2:B8=H2),C2:C8). Both return the first row where every condition is true. XLOOKUP needs Excel 2021 or Microsoft 365.

Key takeaways

  • Join method: look up G2&"|"&H2 in A2:A8&"|"&B2:B8. Easy to read, exact matches only.
  • Boolean method: look up 1 in (A2:A8=G2)*(B2:B8=H2). It also handles conditions like >= and <.
  • Add a separator such as "|" when joining, so AB + C and A + BC don't look the same.
  • Use the 4th argument for a friendly message when no row meets every condition.
  • XLOOKUP needs Excel 2021 or Microsoft 365. In older versions, use INDEX and MATCH with the same logic.
On this page+
  1. Why XLOOKUP needs a trick for multiple criteria
  2. Method 1: Join the criteria with &
  3. Method 2: Multiply TRUE/FALSE tests and look up 1
  4. Which method should you use?
  5. Handle no match and return more than one column
  6. OR logic, last match and older versions of Excel
  7. Common mistakes with XLOOKUP and multiple criteria
  8. Practise it

XLOOKUP with multiple criteria works by combining the conditions into one lookup. You either join the values with &, or multiply TRUE/FALSE tests and look up the number 1. Both find the first row where every condition is true, such as the price of a Hoodie in size M. This guide shows each method step by step on a small price list, when to use which, and how to handle no match.

Why XLOOKUP needs a trick for multiple criteria#

XLOOKUP looks for one value in one list. Its syntax has no slot for a second condition:

Excel formula
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

When the item you want is defined by two columns, neither column alone is enough. In this price list, "Hoodie" appears three times and "M" appears twice, but "Hoodie and M" appears once:

ABC
1ProductSizePrice
2T-shirtS12
3T-shirtM14
4T-shirtL15
5HoodieS30
6HoodieM32
7HoodieL35
8CapOne size10

A plain =XLOOKUP("Hoodie",A2:A8,C2:C8) returns 30, the first Hoodie, whatever the size. The XLOOKUP guide covers the single-condition basics, and the XLOOKUP function guide lists every argument.

All examples below have the product to find in G2 (Hoodie) and the size in H2 (M).

Method 1: Join the criteria with &#

The simplest method joins the criteria into one text value, and joins the columns the same way:

Excel formula
=XLOOKUP(G2&"|"&H2,A2:A8&"|"&B2:B8,C2:C8)

It returns 32. Here is how it works:

  • G2&"|"&H2 becomes the single value Hoodie|M.
  • A2:A8&"|"&B2:B8 builds a list on the fly: T-shirt|S, T-shirt|M, T-shirt|L, Hoodie|S, Hoodie|M, and so on.
  • XLOOKUP finds Hoodie|M in position 5 and returns the 5th price, 32.

The | in the middle is a separator. Without it, different pairs can join into the same text: "AB" plus "C" and "A" plus "BC" both become "ABC". Pick any character that never appears in your data.

This method is easy to read and works for exact matches. It turns numbers into text as it joins them, which is fine as long as you join both sides the same way.

Method 2: Multiply TRUE/FALSE tests and look up 1#

The second method tests each condition separately, then combines the results:

Excel formula
=XLOOKUP(1,(A2:A8=G2)*(B2:B8=H2),C2:C8)

It also returns 32. Step by step:

  1. (A2:A8=G2) checks every product against Hoodie and gives a list of TRUE and FALSE: FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE.
  2. (B2:B8=H2) checks every size against M: FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE.
  3. Multiplying them turns TRUE into 1 and FALSE into 0, and gives 1 only where both are true: 0, 0, 0, 0, 1, 0, 0.
  4. XLOOKUP looks for 1 in that list, finds it in position 5 and returns 32.

The brackets around each test are required. Add a third condition by multiplying again: (A2:A8=G2)*(B2:B8=H2)*(C2:C8>20).

Which method should you use?#

Both give the same answer for exact matches. Choose by the kind of conditions you have:

NeedJoin with &Multiply tests
Exact matches on two or three columnsYes, easiest to readYes
Conditions like >=, < or <>NoYes: (C2:C8>=20)
OR logic (this or that)NoYes, with +
Easy for others to followYesTakes a moment to explain

Use the join method when every condition is "equals". Use the multiply method when any condition compares sizes, dates or amounts. For example, the first Hoodie that costs more than 31:

Excel formula
=XLOOKUP(1,(A2:A8="Hoodie")*(C2:C8>31),B2:B8)

This returns M, the size of the first row that passes both tests.

Handle no match and return more than one column#

If no row meets every condition, XLOOKUP returns #N/A. Use the 4th argument to show a message instead:

Excel formula
=XLOOKUP(G2&"|"&H2,A2:A8&"|"&B2:B8,C2:C8,"Not found")

With Cap and M in G2 and H2, this shows Not found. The guide to XLOOKUP if not found has more options.

To bring back several columns at once, make the return array wider. If the list had a Stock column in D, C2:D8 as the return array would spill the price and the stock side by side. See XLOOKUP with multiple columns for this. The same formulas also work when the price list is on another sheet; just include the sheet name in each range, as shown in XLOOKUP from another sheet.

OR logic, last match and older versions of Excel#

A few variations cover most remaining cases:

  • OR logic. Add the tests instead of multiplying them, then check for more than 0: =XLOOKUP(1,--((A2:A8="Cap")+(B2:B8="L")>0),C2:C8) returns 15, the first row that is a Cap or size L.
  • Last match. Set the 6th argument to -1 to search from the bottom up: =XLOOKUP(1,(A2:A8="Hoodie")*(C2:C8<40),C2:C8,,0,-1) returns 35.
  • Older Excel. XLOOKUP needs Excel 2021, Excel 2024 or Microsoft 365. In older versions, use INDEX and MATCH with the same multiply logic: =INDEX(C2:C8,MATCH(1,(A2:A8=G2)*(B2:B8=H2),0)). In Excel 2019 and earlier, confirm it with Ctrl+Shift+Enter (on a Mac, Control+Shift+Return or ⌘+Shift+Return). The guide to lookups with multiple criteria compares every method, including a helper column.

Common mistakes with XLOOKUP and multiple criteria#

These cause most #N/A results and wrong answers:

  1. Joining only one side. If you join G2 and H2 but not the columns, nothing matches. Join both the same way, with the same separator.
  2. Ranges of different sizes. A2:A8 with B2:B9 returns #VALUE!. Keep every range on the same rows.
  3. Hidden spaces. "Hoodie " with a trailing space doesn't equal "Hoodie". Clean the data with TRIM.
  4. Missing brackets around tests. A2:A8=G2*B2:B8=H2 is read in the wrong order. Write (A2:A8=G2)*(B2:B8=H2).
  5. Numbers vs text. A size typed as the number 10 doesn't equal the text "10". Make both sides the same type.

Practise it#

The join method uses two skills at once: XLOOKUP and joining text. Practise XLOOKUP in a live spreadsheet: you look up in any direction and add a friendly not-found message, and each formula is checked instantly. Then build joined keys with & in the joining text lesson. Start with the Hoodie price in the exercise on this page.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Find the price of a Hoodie in size M. The product is in G2 and the size in H2. In I2, use XLOOKUP and join the two criteria with &"|"&.

fx
ABCDEFGHIJ
1
Product
Size
Price
Product
Size
Price
2
T-shirt
S
12
Hoodie
M
3
T-shirt
M
14
4
T-shirt
L
15
5
Hoodie
S
30
6
Hoodie
M
32
7
Hoodie
L
35
8
Cap
One size
10
9
10
11

Tip: The lookup value is G2&"|"&H2. The lookup array joins the columns the same way: A2:A8&"|"&B2:B8. Return C2:C8.

Practise this in a lesson

LessonXLOOKUPLook up in any direction with XLOOKUP and show a friendly message when nothing matches.LessonJoining text: &, CONCAT and TEXTJOINBuild full names, addresses and tag lists by joining text with &, CONCAT and TEXTJOIN.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.

Frequently asked questions

Can XLOOKUP have multiple criteria?

+

Yes, but not as separate arguments. Combine the criteria by joining them with &, or multiply TRUE/FALSE tests and look up the number 1. Both work in a normal formula in Excel 2021 and Microsoft 365.

How do I use XLOOKUP with two conditions?

+

Use =XLOOKUP(1,(A2:A8=G2)*(B2:B8=H2),C2:C8). Each test gives TRUE or FALSE for every row, multiplying them gives 1 only where both are true, and XLOOKUP returns the price from that row.

Why does my XLOOKUP with multiple criteria return #N/A?

+

No row meets every condition. Check for extra spaces, numbers stored as text, and ranges of different sizes. Add a 4th argument such as "Not found" to show a message instead of #N/A.

Is XLOOKUP with multiple criteria slow?

+

On normal sheets, no. On tens of thousands of rows with many such formulas, a helper column that joins the keys once can be faster, because the joined list isn't rebuilt in every formula.

Sources

  • XLOOKUP function - Microsoft Support
  • Dynamic array formulas and spilled array behavior - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why XLOOKUP needs a trick for multiple criteria
  2. Method 1: Join the criteria with &
  3. Method 2: Multiply TRUE/FALSE tests and look up 1
  4. Which method should you use?
  5. Handle no match and return more than one column
  6. OR logic, last match and older versions of Excel
  7. Common mistakes with XLOOKUP and multiple criteria
  8. Practise it

Keep reading

Lookups· 6 min read

Lookup With Multiple Criteria in Excel

To look up a value that must match two or more criteria, multiply the tests and look up 1: =XLOOKUP(1,(A2:A8=F2)*(B2:B8=F3),C2:C8). Each test gives 1 for TRUE and 0 for FALSE, so only rows that pass every test become 1. In Excel 2019 and earlier, use =INDEX(C2:C8,MATCH(1,(A2:A8=F2)*(B2:B8=F3),0)) or a helper column.

Lookups· 5 min read

XLOOKUP to Return Multiple Columns at Once

Give XLOOKUP a return array that is several columns wide. =XLOOKUP(G2,A2:A6,C2:E6) finds the ID in G2 and returns the matching values from columns C, D and E at once. They spill into the cells to the right, so keep those cells empty. XLOOKUP needs Excel 2021, Excel 2024 or Microsoft 365.

Lookups· 7 min read

XLOOKUP in Excel: Everything a Beginner Needs

XLOOKUP finds a value in one range and returns the matching item from another: =XLOOKUP(G2,B2:B9,A2:A9). It defaults to an exact match, can return a column on either side, and has a built-in if_not_found message instead of #N/A. It needs Excel 2021, Excel 2024 or Microsoft 365; it isn't in Excel 2019 or earlier.

More on lookups

  • XLOOKUP Wildcards and Match Modes Explained
  • XMATCH Function in Excel: Find a Position
  • Check If a Value Exists in a List in Excel
  • Find the Closest Match in Excel
  • How to Compare Two Lists in Excel
  • Find the First Non-Blank Cell in a Row or Column in Excel
All lookups articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free