Excel XLOOKUP with Multiple Column Criteria: How-To
In this article
To look up a value using more than one column as the criteria, use XLOOKUP with a concatenated lookup value and a concatenated lookup array, or switch to Boolean logic with a multiplication formula. The simplest working pattern is =XLOOKUP(A2&B2, D2:D100&E2:E100, F2:F100), where A2 and B2 hold your two criteria, D and E are the criteria columns, and F is the return column. This article explains that pattern, the Boolean alternative, and the traps that make it return #N/A or the wrong row.
What You'll Need
- Excel 365, Excel 2021, or Excel 2024 (XLOOKUP is not in Excel 2019 or earlier; use INDEX/MATCH there).
- Two or more criteria columns in the same table, and a return column to the right or left of them.
- Criteria values in the same data type as the source columns (text vs. number, no stray spaces).
- An Excel Table (Insert > Table) if you want the formula to expand automatically as rows are added.
Step-by-Step
- Lay out your data cleanly. Put each criterion in its own column with a header row, and put the value you want returned in a single column. For example: column D = Region, column E = Product, column F = Price. Keep the ranges the same height; a mismatch is the most common cause of failure.
- Enter your criteria in two cells. Say A2 holds "North" and B2 holds "Widget". Both must match the source exactly, including case-insensitive text but excluding trailing spaces.
- Write the concatenated lookup value. In the result cell, start =XLOOKUP(A2&B2,. The ampersand joins the two criteria into one string. If your criteria are numbers, wrap them: A2&"|"&B2 avoids accidental collisions like 1 and 23 versus 12 and 3.
- Build the concatenated lookup array. Continue with D2:D100&E2:E100,. This joins each row's Region and Product into one string, matching the shape of your lookup value. Use the same delimiter in both halves if you added one.
- Add the return array. Finish with F2:F100). The full formula reads =XLOOKUP(A2&B2, D2:D100&E2:E100, F2:F100). Press Enter.
- Lock the ranges if you will copy the formula. Change the ranges to absolute references ( $D$2:$D$100 ) or, better, convert the data to a Table and use structured references such as . Tables resize themselves, so the formula keeps working when rows are added.
- Add a not-found message. XLOOKUP's fourth argument handles misses: =XLOOKUP(A2&B2, D2:D100&E2:E100, F2:F100, "No match"). This is cleaner than wrapping the whole thing in IFERROR.
- Use the Boolean alternative if you prefer. Instead of concatenation, multiply conditions: =XLOOKUP(1, (D2:D100="North")*(E2:E100="Widget"), F2:F100). Each comparison returns TRUE/FALSE, multiplication turns them into 1/0, and only rows where all conditions are true produce 1. This avoids delimiter problems and works well with three or more criteria.
- Verify with a known row. Pick a row you can see, type its two criteria, and confirm the returned value matches. Then change one criterion to something that does not exist and confirm you get your not-found message rather than a wrong value.
Common Mistakes
- Unequal range heights. D2:D100 and E2:E99 will throw #VALUE! or return nonsense. All three arrays must be the same number of rows.
- Mismatched delimiters. If the lookup value uses "|" but the array uses nothing, nothing matches. Pick one delimiter and use it on both sides.
- Numbers stored as text. A criterion of 100 (number) will not match "100" (text). Use VALUE() or TEXT() to align the types, or clean the source column with Text to Columns.
- Trailing spaces. Imported data often carries invisible spaces. TRIM the source columns or the criteria.
- Forgetting absolute references. Copying the formula down without $ signs shifts the ranges and produces wrong answers or #REF!.
- Using XLOOKUP in an old Excel version. Excel 2019 and earlier do not have it; the formula appears as #NAME?. Use INDEX/MATCH with the same concatenation trick instead.
Tips
- Prefer the Boolean method when you have three or more criteria; the formula stays readable and you avoid delimiter collisions.
- If you need the last matching row rather than the first, add ,-1 as the sixth argument (search mode).
- Use a delimiter that cannot appear in your data, such as a pipe or a tilde, rather than a space or comma.
- Convert the source to an Excel Table so ranges grow automatically; this removes most copy-down errors.
- For a two-column result, XLOOKUP can return multiple columns at once if the return array spans them, but keep it to one column unless you are comfortable with spill behaviour.
Troubleshooting
#N/A even though the row exists. Check for trailing spaces, number-versus-text mismatches, and whether the delimiter appears in both halves. Select a matching cell and compare its length with LEN() against the typed criterion.
#VALUE! error. Almost always unequal range sizes. Highlight each range and confirm the row counts match.
Wrong row returned. XLOOKUP returns the first match by default. If duplicates exist, decide whether you want the first or last (use -1 in the search mode argument) and make sure your criteria are specific enough.
#NAME? error. The function is not recognised: you are on an older Excel version, or the function name is misspelled. Confirm your version under File > Account.
Formula works in one cell but not when copied. Relative references are shifting. Add $ signs or switch to Table structured references.
If that did not work, rebuild the formula one argument at a time: enter the lookup value alone, then the lookup array alone, and check they produce the same string. That isolates which half is wrong.
Frequently Asked Questions
Can XLOOKUP handle more than two criteria?
Yes. Either concatenate all criteria and all criteria columns with the same delimiter, or use the Boolean multiplication method with one comparison per criterion.
Does XLOOKUP work with wildcards?
Yes, when you set the match mode argument to 2. Wildcards apply to text criteria and can be combined with concatenation, but they behave differently from exact matches, so test carefully.
What is the difference between concatenation and Boolean XLOOKUP?
Concatenation joins values into one string and compares strings; Boolean multiplication compares each column separately and multiplies the TRUE/FALSE results. Boolean avoids delimiter collisions and is easier to extend to three or more criteria.
Why does my XLOOKUP return the first match only?
That is the default behaviour. Use the search mode argument (-1) to return the last match, or make the criteria more specific so only one row qualifies.
Can I use XLOOKUP across two different sheets?
Yes. Reference the other sheet in each range, for example Sheet2!$D$2:$D$100, and keep all three ranges the same height.
What replaces XLOOKUP in older Excel versions?
INDEX with MATCH, using the same concatenation or Boolean trick inside MATCH. The logic is identical; only the function names change.