VLOOKUP for 2 Values: How to Match on Two Columns

Formulas & functions · Updated November 23, 2026

To look up a value based on two criteria in Excel, you cannot use a single VLOOKUP directly—VLOOKUP only handles one lookup column. Instead, create a helper column that combines the two lookup values, or use the newer XLOOKUP with concatenated arrays. The simplest method for Excel 365 or 2021 is =XLOOKUP(A2&"|"&B2, Table1[Col1]&"|"&Table1[Col2], Table1[ReturnCol]), which returns the match for both conditions.

Why VLOOKUP Fails with Two Criteria

VLOOKUP searches for a single value in the first column of a table and returns a value from a column to the right. It has no built-in way to check two columns simultaneously. If you try to use two VLOOKUPs nested together, you get the first match for one criterion, not a match for both. For example, looking up a product by both color and size fails because VLOOKUP only sees one of those values at a time.

Method 1: Helper Column (Works in All Excel Versions)

This is the classic solution that works in every version of Excel, including older ones. You add a new column to your data table that concatenates the two lookup values with a separator, then use VLOOKUP on that helper column.

  1. Insert a new column to the left of your lookup table (say column A).
  2. In cell A2, enter =B2&"|"&C2 (assuming B has the first criterion and C has the second). Drag down to fill.
  3. In your lookup cell, enter =VLOOKUP(E2&"|"&F2, A:D, 4, FALSE) where E2 and F2 are your two criteria, and 4 is the column number of the value you want to return.

Use a separator like a pipe | or a hyphen to avoid accidental matches—for example, “AB” and “C” could match “A” and “BC” without a separator. The FALSE argument ensures an exact match; never omit it for text lookups.

Method 2: XLOOKUP with Concatenation (Excel 365 and 2021)

XLOOKUP is more flexible and doesn’t require a helper column. You can build an array of concatenated values directly in the formula:

With your data in A1:C10 (columns: Product, Color, Price), and your two lookup values in E1 and F1, use:

=XLOOKUP(E1&"|"&F1, A2:A10&"|"&B2:B10, C2:C10)

This creates a virtual array of combined values and finds the exact match. If no match exists, XLOOKUP returns #N/A by default. You can add a fourth argument for a custom message: =XLOOKUP(E1&"|"&F1, A2:A10&"|"&B2:B10, C2:C10, "Not found"). This works on Excel for Microsoft 365, Excel 2021, and Excel for the web. It does not work in Excel 2019 or earlier.

Method 3: INDEX and MATCH with Multiple Criteria

For versions without XLOOKUP, INDEX/MATCH is a robust alternative that avoids a helper column. Use array syntax:

=INDEX(C2:C10, MATCH(1, (A2:A10=E1)*(B2:B10=F1), 0))

This is an array formula. In Excel 365 and 2021, it works normally with Enter. In older Excel, you must press Ctrl+Shift+Enter to enter it. The (A2:A10=E1)*(B2:B10=F1) creates an array of 1s and 0s; MATCH finds the position of the 1, and INDEX returns the corresponding value from column C.

Common Problems and How to Fix Them

  • #N/A errors: Usually means no exact match. Check for extra spaces, different data types (text vs. number), or hidden characters. Use =TRIM() on your lookup values.
  • Wrong results with helper column: Ensure the separator character doesn’t appear in your data. If your data contains pipes, use a rare character like ~.
  • Array formula not calculating: In older Excel, if you forget Ctrl+Shift+Enter, you get a #VALUE! error. Press F2 on the cell, then Ctrl+Shift+Enter.
  • Case sensitivity: VLOOKUP and XLOOKUP are case-insensitive. If you need case-sensitive matching, use EXACT() inside an array formula or use XLOOKUP with the match mode argument (but that only affects wildcards, not case).

How to Choose the Right Method

Consider your Excel version and whether you can modify the data. If you are using Excel 2019 or older, use the helper column method for simplicity, or INDEX/MATCH for a no-helper solution. If you have Excel 365 or 2021, XLOOKUP is the cleanest. If your data table is large (thousands of rows), the helper column approach is faster because it avoids array calculations. If you cannot add columns to your source data (e.g., it’s a formatted Excel table), use XLOOKUP or INDEX/MATCH.

Frequently Asked Questions

Can I use VLOOKUP with two columns without a helper column? No, VLOOKUP itself cannot. You must either add a helper column or switch to XLOOKUP or INDEX/MATCH. There is no built-in VLOOKUP syntax for two criteria.

What if my two criteria are in different sheets? The same methods work; just reference the other sheet in the formula. For example, =XLOOKUP(Sheet2!A2&"|"&Sheet2!B2, Sheet1!$A$2:$A$10&"|"&Sheet1!$B$2:$B$10, Sheet1!$C$2:$C$10).

Does this work for numbers and dates? Yes, but be careful with number formatting. If you concatenate a number with a text separator, Excel converts it to text. Ensure your lookup values are formatted the same way—for dates, use TEXT(date,"mm/dd/yyyy") in both the helper column and the lookup formula.

How do I return multiple columns after matching two criteria? Use XLOOKUP with a return array: =XLOOKUP(E1&"|"&F1, A2:A10&"|"&B2:B10, C2:D10) returns both columns C and D. With VLOOKUP, you’d need separate formulas for each column, or use INDEX/MATCH with a column number.

Is there a way to do a two-criteria lookup without concatenation at all? Yes, using the FILTER function in Excel 365: =FILTER(C2:C10, (A2:A10=E1)*(B2:B10=F1), "Not found"). This returns all matching values; if you expect one, wrap it in INDEX(...,1) to get the first.

Practical Example with Real Data

Suppose you have an inventory table with columns: Item ID (A2:A20), Size (B2:B20), Color (C2:C20), and Price (D2:D20). You want to find the price for Item “A-100” in size “M” and color “Red”. Using the helper column method, add column E with =A2&"-"&B2&"-"&C2. Then in G2 (your lookup cell), enter =VLOOKUP("A-100-M-Red", E2:D20, 4, FALSE)—note the column index is 4 because E is column 1, A is 2, B is 3, C is 4, D is 5, so you’d actually use 5. Adjust the column index to match your layout. With XLOOKUP, it’s simpler: =XLOOKUP("A-100"&"-"&"M"&"-"&"Red", A2:A20&"-"&B2:B20&"-"&C2:C20, D2:D20).

Performance and Best Practices

For large datasets, avoid array formulas like INDEX/MATCH with multiple criteria because they recalculate slowly. The helper column method is fastest because it uses a simple VLOOKUP. If you use XLOOKUP with concatenation, Excel creates a temporary array each time, which can be slow on 100,000+ rows. In that case, add a hidden helper column. Also, always use absolute references (e.g., $A$2:$A$1000) when copying formulas down. Finally, if your data is in an Excel Table (Insert > Table), use structured references like Table1[Item] to make formulas self-documenting.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.