Google Sheets VLOOKUP With Two Criteria: How-To
In this article
VLOOKUP by itself can only match one value, so to look something up on two criteria you combine the criteria into a single key. The cleanest way is a helper column that joins two cells with an ampersand, e.g. =A2&"|"&B2, which you then use as the first (leftmost) column for a normal VLOOKUP. If you cannot add a column, an array formula using VLOOKUP with a concatenated lookup value and a virtual array, or a combination of INDEX and MATCH with &, does the same job without helper cells. This guide covers both routes, what to do when the formula returns #N/A, and the traps that make it fail silently.
What You'll Need
- A Google Sheet with data laid out in columns, ideally with a header row.
- The two values you want to match on, each in its own column.
- The column you want to return (the result column) positioned to the right of the lookup column for plain VLOOKUP.
- Basic familiarity with cell references and the
&operator for joining text. - Edit access to the sheet if you plan to add a helper column; view-only access limits you to array formulas in cells you can edit.
Google Sheets labels can differ slightly by language and region, but formula syntax is the same everywhere. If your sheet uses a locale where the comma is the decimal separator, argument separators may appear as semicolons.
Step-by-Step
- Decide which two columns form your key. For example, a sales sheet might have Region in column A and Product in column B, and you want the Sales figure in column C. Write down the exact columns you will join.
- Insert a helper column immediately to the left of your data range. Right-click the column letter, choose Insert 1 left. This is optional if you use the array method later, but it keeps things simple. You can put the helper to the right of your data if you adjust the ranges, as long as the joined key will be the leftmost column VLOOKUP searches.
- Build the joined key in the first data row. In the helper cell next to your first data row, type something like
=A2&"|"&B2. The pipe character|is a delimiter that prevents false matches, such as "East" + "Side" colliding with "Easts" + "ide". - Copy the formula down. Drag the small fill handle at the bottom-right of the cell to the last row, or double-click the handle to fill automatically. Check a few rows to confirm every key looks right.
- Write the VLOOKUP on a separate sheet or in an empty area. Put your two search values in two cells, say G2 (Region) and H2 (Product). Then in the result cell, type
=VLOOKUP(G2&"|"&H2, $A$2:$D$100, 4, FALSE)and press Enter. - Check the column index. In that example, column A is 1, B is 2, C is 3 and D is 4, so
4returns column D. Count from the first column of the range, not from the sheet's column A. - Keep the last argument FALSE for an exact match. If you omit it, Sheets may return an approximate match and give you the wrong row.
- Wrap the formula in IFERROR to control what appears when nothing matches:
=IFERROR(VLOOKUP(G2&"|"&H2, $A$2:$D$100, 4, FALSE), "Not found"). - Use the array method if you cannot add a helper column. Type
=ARRAYFORMULA(VLOOKUP(G2&"|"&H2, {A2:A100&"|"&B2:B100, C2:D100}, 3, FALSE)). Here the curly brackets build a temporary two-part array: the joined key first, then the columns you want. The column index refers to that array, so3means the second column after the joined key if you included two columns. - Alternatively use INDEX and MATCH. Type
=INDEX(C2:C100, MATCH(1, (A2:A100=G2)*(B2:B100=H2), 0)). In Microsoft Excel this needs Ctrl+Shift+Enter in older versions; Google Sheets handles it as an array automatically in most cases, and wrapping it in ARRAYFORMULA is the safe choice. - Test with a known row. Pick a pair you can verify by eye, run the formula, and confirm the returned value is correct. Then change one criterion to something that does not exist and confirm you get your IFERROR message rather than a wrong number.
Common Mistakes
- Missing or mismatched delimiters. If the helper column uses
&"|"&but the lookup uses plain&, nothing will ever match. Use exactly the same construction in both places. - Spaces and case inconsistencies. "New York " with a trailing space is a different key from "New York". Use
TRIMon both sides if your data is messy. - Numbers versus text. A product code stored as text in one column and as a number in another will not join equal keys. Convert with
TEXTorVALUEso both sides share a type. - Helper column to the right of the data. VLOOKUP only searches the leftmost column of the given range, so a key placed at the end returns #N/A.
- Wrong column index. Counting the range from column A instead of from the first column of the range is the single most common cause of wrong values.
- Omitting FALSE. Without it, VLOOKUP defaults to approximate matching on unsorted text and can return nonsense.
- Ranges that do not cover all rows. If you add new data below row 100 and your range stops there, the lookup misses it. Lock ranges with
$and extend them, or use open-ended references. - Deleting the helper column later without updating the formulas, which breaks every lookup that depended on it.
Tips
- Use a delimiter that cannot appear naturally in your data, such as
|,~or a double underscore, to avoid accidental collisions. - Name your helper column clearly, for example "Region|Product Key", so anyone opening the sheet understands it.
- Prefer XLOOKUP if your sheet supports it:
=XLOOKUP(G2&"|"&H2, A2:A100&"|"&B2:B100, C2:C100)avoids column counting entirely. Availability depends on the account and workspace, so fall back to INDEX/MATCH if the formula errors. - Convert your range to a named range (Data > Named ranges) so formulas stay readable and survive row insertions.
- Keep the search values in their own cells rather than hard-coding them inside the formula, so you can rerun the lookup for many rows by copying down.
- Freeze the header row so you can check column order while editing formulas further down.
Troubleshooting
You get #N/A for a row you know exists. Check for hidden spaces, mismatched delimiters and number-versus-text formatting. A quick test: put both keys side by side and use =A2=B2 to see whether Sheets treats them as equal.
The formula returns the wrong row. Almost always the column index or a missing FALSE argument. Recheck both, then confirm the range starts at the same column that holds your key.
You get #REF!. The column index is larger than the number of columns in your range, or the range itself has been deleted or shifted.
You get #VALUE!. Usually a syntax problem such as an unmatched quote, or a locale issue where argument separators should be semicolons. Try retyping the formula from scratch rather than editing a copied one.
The array version spills or errors. Confirm the curly-bracket array has a joined key followed by return columns, and that the index points into that array. If it still fails, delete the cell, retype the whole formula and press Enter rather than pasting from another app, which can bring in invisible characters.
New rows are not found. Extend the ranges or use open-ended references like A2:A where the formula tolerates them, and re-copy the formula down.
Nothing works and the sheet feels broken. Make a copy of the file before experimenting, then test the formula in a fresh, small sheet with two columns of sample data to isolate whether the problem is the formula or the dataset.
Frequently Asked Questions
Can VLOOKUP match two criteria without a helper column?
Yes. Use ARRAYFORMULA with a virtual array built in curly brackets, or use INDEX and MATCH with multiplication of the two conditions. Both avoid adding a column.
Why does my two-criteria VLOOKUP return #N/A?
The joined keys are not identical. Common causes are extra spaces, a different delimiter, or one value stored as text and the other as a number.
Is INDEX/MATCH better than VLOOKUP here?
For two criteria it is often more readable and does not depend on column position, so inserting columns will not break it. VLOOKUP with a helper column is faster to set up for beginners.
Can I use more than two criteria?
Yes. Join as many cells as you need with the same delimiter, for example =A2&"|"&B2&"|"&C2, and apply the identical pattern to the lookup value.
Does this work in Excel too?
The helper-column method works the same way in Excel. The curly-bracket array method also works, but older Excel versions require Ctrl+Shift+Enter and newer ones use dynamic arrays.
Should I use TRUE or FALSE as the last argument?
Use FALSE for an exact match on two criteria. TRUE is for sorted approximate matching and will give unpredictable results with joined text keys.