You cannot make VLOOKUP look to the left. VLOOKUP only searches the first column of a table and returns a value from a column to the right. To look up a value that is to the left of your lookup column, use INDEX and MATCH, or XLOOKUP if you have Excel 2021 or Microsoft 365.
Why VLOOKUP Cannot Look Left
VLOOKUP’s syntax is VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). The function forces the lookup column to be the leftmost column in the table_array, and the col_index_num counts columns from that leftmost column to the right. There is no argument to specify a different lookup column or a negative column index. This design is a legacy limitation from the 1980s when the function was first introduced in Lotus 1-2-3, and Microsoft kept it for compatibility.
For example, if you have data with Product ID in column B and Product Name in column A, and you want to find the Product Name for a given ID, VLOOKUP cannot do it because the ID is not in the leftmost column of your selected range. You would need to rearrange your columns or use a different function.
The INDEX and MATCH Solution
INDEX and MATCH is the classic workaround that works in every version of Excel. The formula is:
=INDEX(return_range, MATCH(lookup_value, lookup_range, 0))
Here’s how it works in practice. Suppose your data has Product Names in A2:A10 and Product IDs in B2:B10. You want to find the name for ID “P123” entered in cell D2. The formula in E2 would be:
=INDEX(A2:A10, MATCH(D2, B2:B10, 0))
This returns the product name from column A where the ID in column B matches D2. The MATCH part finds the row number where the ID appears, and INDEX returns the value from that row in column A. The 0 in MATCH means exact match, which is what you should use for IDs or codes.
If the ID is not found, the formula returns #N/A. You can wrap it in IFERROR to show a friendly message:
=IFERROR(INDEX(A2:A10, MATCH(D2, B2:B10, 0)), "Not found")
Using XLOOKUP to Look Left
If you have Excel 2021 or Microsoft 365, XLOOKUP is simpler and more powerful. Its syntax is:
XLOOKUP(lookup_value, lookup_range, return_range, [if_not_found], [match_mode], [search_mode])
You can specify the lookup range and return range independently, so looking left is trivial. Using the same example, the formula in E2 would be:
=XLOOKUP(D2, B2:B10, A2:A10, "Not found")
This looks for D2 in B2:B10 and returns the corresponding value from A2:A10. The fourth argument is the text to show if no match is found. XLOOKUP defaults to exact match, so you don’t need to specify match_mode. On Mac, the formula works identically. In Excel for the web, XLOOKUP is also available.
How to Choose Between INDEX/MATCH and XLOOKUP
Your choice depends on your Excel version and your needs. Here are the key factors:
- Excel version: If you use Excel 2019 or earlier, XLOOKUP is not available. Use INDEX/MATCH.
- Simplicity: XLOOKUP is easier to read and write, especially for beginners.
- Flexibility: XLOOKUP can return multiple columns, search from the end, and handle errors inline. INDEX/MATCH can also return multiple columns but with more complex array formulas.
- Performance: For very large datasets (hundreds of thousands of rows), INDEX/MATCH can be slightly faster than XLOOKUP in some cases, but the difference is usually negligible.
If you are sharing the workbook with others who may have older Excel, INDEX/MATCH is the safer choice because it works everywhere.
Common Problems and How to Avoid Them
When you switch to INDEX/MATCH or XLOOKUP, watch out for these pitfalls:
- Mismatched ranges: The lookup range and return range must have the same number of rows. If they don’t, you’ll get a #VALUE! error.
- Exact vs. approximate match: Always use
0in MATCH or rely on XLOOKUP’s default exact match. Approximate match can return incorrect results if your data isn’t sorted. - Hidden spaces or non-printable characters: If your lookup value has trailing spaces, it won’t match. Use
TRIMorCLEANto clean data. - Case sensitivity: Both MATCH and XLOOKUP are case-insensitive by default. If you need case-sensitive matching, use
EXACTin an array formula or XLOOKUP with match_mode 2? Actually, XLOOKUP doesn’t have a case-sensitive option directly; you’d need to useINDEXwithMATCHandEXACTin an array formula.
Real Example: Employee Lookup
Let’s say you have a table with Employee ID in column B and Employee Name in column A. You want to find the name for ID “E102”. Your data is in rows 2 to 20. In cell D2, you type the ID, and in E2 you want the name.
Using INDEX/MATCH:
=INDEX(A2:A20, MATCH(D2, B2:B20, 0))
Using XLOOKUP:
=XLOOKUP(D2, B2:B20, A2:A20, "No employee found")
Both will return the correct name. If the ID doesn’t exist, the first returns #N/A, the second returns the custom message.
Alternatives: CHOOSE and HLOOKUP
There are other ways to look left, though they are less common:
- CHOOSE: You can use
CHOOSEto reorder columns on the fly. For example,VLOOKUP(D2, CHOOSE({1,2}, B2:B20, A2:A20), 2, FALSE)creates a virtual table with ID first and Name second, allowing VLOOKUP to work. However, this is an array formula and can be slow on large data. - HLOOKUP: This is for horizontal data, not vertical. If your data is arranged in rows instead of columns, HLOOKUP has the same limitation—it can only look to the right (or below) in a row, not above. So it doesn’t solve the left problem for vertical data.
For most users, INDEX/MATCH or XLOOKUP is the best solution.
Frequently Asked Questions
Can I use VLOOKUP to look up values in a column to the left?
No. VLOOKUP is hardcoded to search the first column of the table array and return values from columns to the right. There is no way to make it look left. Use INDEX/MATCH or XLOOKUP instead.
What is the difference between INDEX/MATCH and VLOOKUP?
INDEX/MATCH is more flexible because it allows you to specify the lookup column and return column independently. It also handles columns to the left and doesn’t break if you insert a column in the table. VLOOKUP is simpler but limited to looking right.
Does XLOOKUP work in Excel 2019?
No. XLOOKUP is only available in Excel 2021 and Microsoft 365. If you have Excel 2019 or earlier, use INDEX/MATCH.
How do I handle errors when the lookup value is not found?
With INDEX/MATCH, wrap the formula in IFERROR. With XLOOKUP, use the fourth argument to specify a custom message. For example: =IFERROR(INDEX(A:A, MATCH(D2, B:B, 0)), "Not found") or =XLOOKUP(D2, B:B, A:A, "Not found").
Can I use VLOOKUP with a helper column to look left?
Yes, you can add a helper column that duplicates the lookup column to the left of the return column. For example, if you want to look up ID in B and return Name in A, you could add a column C that copies B, then use VLOOKUP on C and return from A. But this requires modifying your data, which is often not desirable.
Is INDEX/MATCH faster than XLOOKUP?
In most cases, the performance difference is negligible. For very large datasets, INDEX/MATCH can be slightly faster because it uses a more direct calculation path. However, XLOOKUP is more convenient and easier to maintain.
Related
- By Means of an Update? Meaning & Real Usage
- Windows Ctrl Shortcuts: The Complete List
- Speed and Intersection Safety Cameras: How They Work
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Tables: Do New Rows Keep Formulas?Yes. In Excel for Microsoft 365 on Windows, a table normally carries a calculated-column formula into new rows,…
- How to Sort in Excel: Rows, Columns & FiltersSorting in Excel puts your data in a logical order—alphabetically, numerically, by date, or by color—so you can…
- Excel Formula for Calculating Overtime HoursTo calculate daily overtime in Excel, subtract unpaid break hours and the regular-hours threshold from the shift length,…
- Excel Formula to Check Yes or No in Another ListYes. To show whether a value in one cell appears anywhere in another list, use COUNTIF inside IF.…
- INDEX Excel Arguments Explained: Syntax and ExamplesIn Excel, INDEX returns a value or reference at the intersection of a specified row and column in…
- How to Execute a Function in PostgreSQLExecuting a function in PostgreSQL means calling it so it runs its SQL logic and returns a result.…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.