Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel VLOOKUP Multiple Criteria: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

VLOOKUP cannot match two criteria on its own, but you can make it do so by adding a helper column that joins the values you want to match. Concatenate the criteria into one string, then look up that combined string. The result is a normal VLOOKUP that behaves exactly as expected. This guide walks through the helper-column method, which works in every Excel version, and then shows the modern alternative using XLOOKUP if you have Microsoft 365 or Excel 2021. Before you start, make sure your data is in a clean table with no merged cells in the lookup range, and that the columns you want to match are formatted consistently (text vs. number).

What You'll Need

  • Excel 2016 or later (the helper-column method works in all versions; XLOOKUP requires Microsoft 365 or Excel 2021).
  • A dataset with at least two columns you want to use as criteria and one column you want to return.
  • Consistent data types: if one criterion is text and the other is a number, convert both to text before joining them.
  • No merged cells in the lookup table, and no leading or trailing spaces in the criteria columns.

Step-by-Step

  1. Insert a helper column. In your data table, add a new column to the right of the existing data (or to the left, but the helper column must be the first column of the lookup range if you use VLOOKUP). Give it a clear header such as Key.
  2. Build the combined key. In the first data row of the helper column, enter a formula that joins the two criteria with a delimiter. For example, if criteria are in columns A and B, use =A2&"|"&B2. The pipe character | is a safe delimiter because it rarely appears in real data. Copy this formula down to every row.
  3. Create the lookup key in your result area. Where you want the answer, build the same combined key from the criteria you are searching for. For example, if you type the first criterion in cell F2 and the second in G2, the lookup key is =F2&"|"&G2. Put this in a helper cell (say H2) so the VLOOKUP formula stays readable.
  4. Write the VLOOKUP. Use the helper column as the first column of the table array. For example: =VLOOKUP(H2, $C$2:$E$100, 3, FALSE). Here C is the helper column, D and E are the return columns, and 3 means return the third column of the range (column E). The FALSE argument forces an exact match.
  5. Lock the ranges. Press F4 to make the table array absolute ($C$2:$E$100) so you can copy the formula down without the range shifting.
  6. Copy down and test. Drag the formula down for each row of criteria. Check a few results manually by filtering the source data on both criteria to confirm the returned value is correct.
  7. Optional: wrap in IFERROR. If a combination does not exist, VLOOKUP returns #N/A. Wrap the formula: =IFERROR(VLOOKUP(...), "Not found") to show a clean message instead of an error.
  8. Alternative without a helper column (array formula). If you cannot add a column, use an array formula: {=INDEX(return_range, MATCH(1, (criteria1_range=F2)*(criteria2_range=G2), 0))}. In Microsoft 365 you can enter it without Ctrl+Shift+Enter; in older versions press Ctrl+Shift+Enter. This is slower on large datasets and harder to debug, so prefer the helper column unless you have a reason not to.
  9. Modern alternative: XLOOKUP. In Microsoft 365 or Excel 2021, XLOOKUP can handle multiple criteria natively using Boolean logic: =XLOOKUP(1, (A2:A100=F2)*(B2:B100=G2), E2:E100, "Not found"). This avoids the helper column entirely. Note that XLOOKUP is not available in Excel 2019 or earlier.

Common Mistakes

  • Mismatched data types. If one criterion is stored as text (e.g., "00123") and the other as a number (123), the joined keys will not match. Convert both to text with TEXT() or by formatting the column as Text before joining.
  • Forgetting the delimiter. Joining without a separator (e.g., A2&B2) can create false matches: "AB" + "C" equals "A" + "BC". Always use a delimiter like | or ~.
  • Using approximate match. Omitting the fourth argument or setting it to TRUE can return wrong values. Always use FALSE or 0 for exact match.
  • Helper column not first in the range. VLOOKUP searches the leftmost column of the table array. If the helper column is not the first column in the range, the formula will fail or return the wrong column.
  • Hidden spaces. Extra spaces in either the source data or the lookup criteria break exact matches. Use TRIM() on both sides when building keys.
  • Copying without absolute references. If the table array is not locked with $, copying the formula down shifts the range and returns wrong results.

Tips

  • Use a delimiter that does not appear in your data. Pipe | and tilde ~ are usually safe; commas and hyphens often are not.
  • Convert your data range to an Excel Table (Ctrl+T). Structured references make formulas easier to read and automatically expand when you add rows.
  • If you need to return multiple columns, copy the VLOOKUP across and change the column index number each time, or switch to INDEX/MATCH which lets you reference the return column directly.
  • For large datasets, the helper-column VLOOKUP is faster than array formulas because it uses a single exact-match lookup rather than evaluating arrays.
  • Keep the helper column visible or clearly labeled; if you hide it, document it in a note so future editors understand the formula.
  • Test with a known combination first. Pick a row where you can manually verify the answer before copying the formula to hundreds of rows.

Troubleshooting

If you see #N/A, the combined key does not exist in the helper column. Check for trailing spaces, mismatched data types, or a missing delimiter. Use =LEN() on both keys to compare lengths; a difference usually points to hidden spaces. If the formula returns the wrong value, confirm the column index number is correct and that the helper column is the first column of the table array. If copying the formula produces shifting errors, verify the table array uses absolute references ($). If XLOOKUP returns #VALUE!, check that the criteria ranges are the same size. If you are on Excel 2019 or earlier, XLOOKUP will not work at all; use the helper-column method instead. For array formulas that return #N/A, confirm you entered them with Ctrl+Shift+Enter in older Excel versions, and that the ranges in the MATCH are the same size.

Frequently Asked Questions

Can VLOOKUP handle more than two criteria?

Yes. Join all criteria into one key with delimiters, e.g., =A2&"|"&B2&"|"&C2, and use that as both the helper column and the lookup value. The same logic scales to any number of criteria.

Do I need a helper column?

No, but it is the simplest and most reliable method. The alternative is an INDEX/MATCH array formula or XLOOKUP (Microsoft 365/Excel 2021), both of which avoid the helper column but are harder to write and slower on large data.

Why does my VLOOKUP return #N/A even though the values look the same?

Most often it is a data type mismatch (text vs. number) or hidden spaces. Use TRIM() and TEXT() to normalize both the source and lookup keys, and check with =EXACT() to compare two cells character by character.

Can I use VLOOKUP with criteria in different columns?

Yes, as long as you build the helper key from those columns in the same order on both sides. The order must match exactly: if the source key is A&"|"&B, the lookup key must also be first_criterion&"|"&second_criterion.

Does XLOOKUP work in Excel 2019?

No. XLOOKUP is available only in Microsoft 365 and Excel 2021 and later. In Excel 2019 and earlier, use the helper-column VLOOKUP or INDEX/MATCH array formula.

How do I return multiple columns with multiple criteria?

Use the helper-column VLOOKUP and change the column index number for each return column, or use INDEX/MATCH where you can reference the return column directly. For example, =INDEX(D:D, MATCH(1, (A:A=F2)*(B:B=G2), 0)) returns column D without a helper column.