VLOOKUP With Multiple Criteria

VLOOKUP can only test one column. To look up a value that must match two or more conditions — say a product and a region — use XLOOKUP, INDEX MATCH, or a helper column. Describe your data below and get the exact formula.

Free, no sign-up required · 5 free generations a day

Last updated

Describe your task, get the formula

Type what you need in plain English, or pick an example below. You get the formula, a step-by-step explanation, and a worked example.

Formulas for looking up on two conditions

Syntax
=XLOOKUP(1,(A2:A100=F2)*(B2:B100=G2),C2:C100)
=INDEX(C2:C100,MATCH(1,(A2:A100=F2)*(B2:B100=G2),0))
=VLOOKUP(F2&G2,D2:E100,2,FALSE)

Each comparison in brackets returns TRUE or FALSE, and multiplying them gives 1 only on the rows where every condition is true. XLOOKUP or MATCH then finds that 1. The third formula is the classic alternative: a helper column D that joins the two key columns (=A2&B2), which a normal VLOOKUP can then search.

Examples

Look up on two conditions with XLOOKUP

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

Returns the value from column C on the row where column A equals F2 and column B equals G2. The fourth argument shows Not found instead of #N/A when no row matches both.

The same lookup with INDEX MATCH

=INDEX(C2:C100,MATCH(1,(A2:A100=F2)*(B2:B100=G2),0))

Works in every version of Excel and in Google Sheets. In Excel 2019 and earlier confirm it with Ctrl+Shift+Enter; in Google Sheets wrap the multiplication in ARRAYFORMULA.

Helper column plus a normal VLOOKUP

=VLOOKUP(F2&"|"&G2,$D$2:$E$100,2,FALSE)

Put =A2&"|"&B2 in helper column D and the result in column E, then search the joined key. The separator stops accidental matches such as 1 and 23 against 12 and 3.

Common mistakes and how to fix them

#N/A even though both values exist

The two values probably sit on different rows, or one of them has a trailing space or is stored as text. Clean the inputs with TRIM and check that numbers are real numbers.

The array formula only works in some cells

In Excel 2019 and earlier, a formula that multiplies ranges must be confirmed with Ctrl+Shift+Enter. Excel 2021 and Microsoft 365 handle it automatically.

Joined keys match the wrong row

Joining 1 and 23 gives 123, the same as 12 and 3. Always put a separator that cannot appear in the data between the parts, such as |.

Frequently asked questions

Can VLOOKUP itself use two criteria?

Not directly — it compares one value against one column. You either add a helper column that joins the two criteria, or use XLOOKUP or INDEX MATCH, which can test several conditions in one formula.

Which method is best?

XLOOKUP is the shortest if you have Excel 2021 or Microsoft 365. INDEX MATCH works everywhere. A helper column is the easiest to read and audit, and it is the fastest on very large sheets.

Does this work in Google Sheets?

The helper-column VLOOKUP works unchanged. For INDEX MATCH, wrap the multiplied conditions in ARRAYFORMULA so Sheets evaluates them as an array.

Don't want to write it by hand?

Describe what you need in plain English and get a ready-to-use formula in seconds.

Try the formula generator