VLOOKUP in Excel searches for a value in the first column of a table and returns a corresponding value from another column in the same row. For example, =VLOOKUP("Apple", A2:C10, 2, FALSE) finds “Apple” in A2:A10 and returns the value from column B in that row.
What Is VLOOKUP and Why Does It Matter?
VLOOKUP stands for “Vertical Lookup.” It is one of the most used functions in spreadsheet software because it lets you pull data from one table into another based on a shared key—like a product ID, email address, or employee number. Before VLOOKUP, users had to manually copy data or write complex nested formulas. VLOOKUP simplified that task, and even though newer functions like XLOOKUP exist, VLOOKUP remains widely taught and used, especially in older workbooks and many corporate templates.
The function has four arguments: lookup_value (what you search for), table_array (the range containing the data), col_index_num (which column to return from), and range_lookup (TRUE for approximate match, FALSE for exact match). Understanding these four parts is the key to using VLOOKUP correctly.
How to Use VLOOKUP: Step-by-Step
Assume you have a product list in cells A2:C10, with product names in column A, prices in column B, and stock in column C. You want to find the price of “Widget”.
- Click the cell where you want the result (e.g., E2).
- Type
=VLOOKUP(. - Enter the lookup value: either a cell reference like
D2(which contains “Widget”) or a literal like"Widget". - Enter the table array:
A2:C10(the range that includes the lookup column and the return column). - Enter the column index:
2for price (since price is the second column in the range). - Enter
FALSEfor an exact match (most common). - Close the parenthesis and press Enter:
=VLOOKUP(D2, A2:C10, 2, FALSE).
If D2 contains “Widget”, the formula returns the price from column B. If it returns #N/A, the value isn’t found—check spelling or data type.
Choosing Between VLOOKUP, HLOOKUP, and XLOOKUP
VLOOKUP searches vertically (down a column). HLOOKUP searches horizontally (across a row). XLOOKUP, available in Excel 2021 and Microsoft 365, is a modern replacement that searches in any direction, allows leftward lookups, and handles missing values more gracefully. For new workbooks, XLOOKUP is often easier, but VLOOKUP is still essential for compatibility with older files and for users on older Excel versions.
Key differences:
- Search direction: VLOOKUP only looks to the right of the lookup column. XLOOKUP can return values from columns to the left.
- Exact vs. approximate: VLOOKUP defaults to approximate match if you omit the fourth argument, which can cause errors. XLOOKUP defaults to exact match.
- Error handling: XLOOKUP has an optional
if_not_foundargument; VLOOKUP returns #N/A. - Column insertion: Adding a column in the table breaks VLOOKUP’s column index; XLOOKUP uses ranges, so it’s more robust.
Common VLOOKUP Errors and How to Fix Them
VLOOKUP frequently returns errors that confuse users. Here are the most common and their fixes:
- #N/A: The lookup value isn’t found. Check for extra spaces, different data types (text vs. number), or that the lookup column is actually the first column of the table array.
- #REF!: The column index is larger than the number of columns in the table array. Count columns carefully.
- #VALUE!: The column index is less than 1 or the lookup value is not a valid type.
- Incorrect results with TRUE: If you use TRUE (approximate match) without sorting the first column, you get unpredictable results. For most lookups, use FALSE.
Another common issue: VLOOKUP cannot look to the left. If you need to return a value from a column to the left of the lookup column, rearrange your data or use INDEX/MATCH or XLOOKUP.
VLOOKUP with Approximate Match: When to Use It
Approximate match (range_lookup = TRUE) is useful for finding values in ranges, such as tax brackets, discount tiers, or grade boundaries. For example, to assign a letter grade based on a score, you could have a table with minimum scores in column A and grades in column B, sorted ascending. Then =VLOOKUP(score, A2:B6, 2, TRUE) returns the grade for the largest score less than or equal to the lookup value.
Important: The first column must be sorted in ascending order for TRUE to work correctly. If not, results are unreliable. For exact matches, always use FALSE.
VLOOKUP vs. INDEX/MATCH: Which Is Better?
INDEX/MATCH is an alternative that overcomes VLOOKUP’s limitations. The formula =INDEX(return_range, MATCH(lookup_value, lookup_range, 0)) does the same job but allows leftward lookups and is less fragile when columns are inserted. For example, with names in A2:A20 and sales in B2:B20, to find sales for “Smith”, use =INDEX(B2:B20, MATCH("Smith", A2:A20, 0)).
INDEX/MATCH is more flexible, but VLOOKUP is simpler to write and read for basic rightward lookups. Many users stick with VLOOKUP because it’s familiar. For new workbooks, XLOOKUP is the best of both worlds.
Frequently Asked Questions
Why does VLOOKUP return #N/A even though the value exists?
Often the lookup value has invisible spaces or is stored as text while the table contains numbers (or vice versa). Use =TRIM() to remove spaces, or ensure both are the same data type. Also confirm the lookup column is the first column in the table array—VLOOKUP only searches the leftmost column of the range.
Can VLOOKUP return multiple columns at once?
No, VLOOKUP returns only one value per formula. To get multiple columns, you’d need separate VLOOKUP formulas for each column, or use XLOOKUP with an array formula (in Microsoft 365) or INDEX/MATCH with multiple matches. For a single row, you can copy the formula across columns and adjust the column index.
Does VLOOKUP work with wildcards?
Yes, for text lookups with FALSE, you can use wildcards: * (any sequence) and ? (single character). For example, =VLOOKUP("A*", A2:B10, 2, FALSE) finds the first value starting with “A”. This is handy for partial matches.
What’s the difference between VLOOKUP and HLOOKUP?
VLOOKUP searches vertically (down the first column) and returns a value from a column to the right. HLOOKUP searches horizontally (across the first row) and returns a value from a row below. Use HLOOKUP when your data is organized in rows rather than columns.
Is VLOOKUP case-sensitive?
No, VLOOKUP is not case-sensitive. “apple” and “APPLE” are treated as the same. If you need case-sensitive matching, use the EXACT function combined with INDEX/MATCH or XLOOKUP.
How do I use VLOOKUP with data on another sheet?
Include the sheet name in the table array, like =VLOOKUP(D2, Sheet2!A2:C10, 2, FALSE). If the sheet name has spaces, enclose it in single quotes: ='My Sheet'!A2:C10.
Related
- How to Change View Angle in Google Earth
- Number 4 Foil Balloon: Sizes, Helium, and How to Inflate
- Can C++ Be Split? Yes—Here’s How and Why
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Count Unique Values in Excel: UNIQUE & COUNTATo count unique values in a list in Microsoft Excel, use the COUNTA function wrapped around the UNIQUE…
- Copy and Paste Dates in Sequence in Excel: Step-by-StepTo create dates that increase in order, enter the first two dates in adjacent cells, select both, and…
- Excel Filter Dates by Year: Quick Steps and FixesTo filter dates by year in Excel for Microsoft 365 on Windows, open the filter arrow in the…
- How to Add Double Quotes in an Excel Formula for TextTo show double quotation marks in text produced by an Excel formula, type each quote mark twice inside…
- Python String Functions: The Complete GuidePython string functions are built-in methods that operate on string objects to manipulate, inspect, or transform text. They…
- Excel XLOOKUP Multiple Criteria: Formulas and ExamplesYes. In Microsoft Excel for Microsoft 365, XLOOKUP can match multiple criteria by multiplying comparison tests so that…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.