VLOOKUP is an Excel function that searches for a value in the first column of a table and returns a matching value from another column in the same row. In plain terms, it’s like looking up a phone number in a directory: you give it a name, and it gives you the number.
What Exactly Does VLOOKUP Do?
VLOOKUP stands for “Vertical Lookup.” It works on data arranged in columns, where each row is a record. For example, you might have a product list with columns: Product ID (column A), Product Name (column B), and Price (column C). If you want to find the price of a product with ID “P102”, VLOOKUP can do that automatically.
The function has four arguments, written like this:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
- lookup_value – what you’re searching for (e.g., “P102”).
- table_array – the range of cells that contains the data (e.g., A2:C10).
- col_index_num – the column number in the table from which to return a value (1 for first column, 2 for second, etc.).
- range_lookup – TRUE for approximate match, FALSE for exact match. For most real-world uses, you want FALSE.
How to Use VLOOKUP: Step-by-Step
Let’s walk through a practical example. Suppose you have this data in cells A1:C5:
- A1: “ID”, B1: “Name”, C1: “Price”
- A2: “P101”, B2: “Widget”, C2: 5.00
- A3: “P102”, B3: “Gadget”, C3: 7.50
- A4: “P103”, B4: “Gizmo”, C4: 9.99
- A5: “P104”, B5: “Thing”, C5: 12.00
To find the price of the product with ID “P102”, type this in any empty cell:
=VLOOKUP("P102", A2:C5, 3, FALSE)
This returns 7.50. The function looks down column A for “P102”, finds it in row 3, and returns the value from column 3 of that row (which is column C).
If you want to make it dynamic, put the lookup value in a cell, say E1, and use =VLOOKUP(E1, A2:C5, 3, FALSE). Now you can change E1 to any ID and the formula updates.
Exact vs. Approximate Match: Which to Use?
The fourth argument, range_lookup, is often misunderstood. Use FALSE for an exact match. This is what you need when looking up IDs, names, or any specific text. If you use TRUE (or omit it), VLOOKUP will find the closest match that is less than or equal to the lookup value, but only if the first column is sorted in ascending order. This is useful for finding tax brackets, discount tiers, or shipping rates based on a numeric threshold.
Example of approximate match: You have a table of shipping costs by weight. Column A has weight limits (0, 10, 20, 50), column B has costs. To find the cost for a 35-pound package, use =VLOOKUP(35, A2:B5, 2, TRUE). It will return the cost for the 20-pound row because 35 is between 20 and 50. For most everyday lookups, stick with FALSE to avoid surprises.
Common VLOOKUP Mistakes and How to Fix Them
- #N/A error – The lookup value isn’t found. Check for extra spaces, inconsistent text (e.g., “P102” vs “P102 ”), or numbers stored as text. Use the TRIM function to clean data.
- #REF! error – The column index number is greater than the number of columns in the table. Count your columns carefully.
- Wrong results with TRUE – If you forget the fourth argument, Excel assumes TRUE. Always specify FALSE for exact matches.
- Table range not absolute – When copying the formula down, the table range shifts. Use absolute references like
$A$2:$C$5to lock it. - Lookup column not the first column – VLOOKUP can only search the leftmost column of the table. If your lookup value is in column B and you need a value from column A, VLOOKUP won’t work. Consider using INDEX/MATCH or XLOOKUP instead.
VLOOKUP vs. INDEX/MATCH vs. XLOOKUP
VLOOKUP is easy to learn but has limitations. It can’t look to the left, it breaks if you insert or delete columns, and it only returns one value. INDEX/MATCH is a more flexible alternative that can look in any direction and is less prone to breaking. XLOOKUP, available in Excel 2021 and Microsoft 365, is the modern replacement: it can search left or right, return multiple values, and handle errors more gracefully.
Here’s a quick comparison:
- VLOOKUP – Simple, but requires lookup column to be first, and column index is fixed.
- INDEX/MATCH – More complex but flexible. Example:
=INDEX(C2:C5, MATCH("P102", A2:A5, 0))returns the price. - XLOOKUP – Easiest and most powerful. Example:
=XLOOKUP("P102", A2:A5, C2:C5)returns the price. It works in Excel 2021 and Microsoft 365.
If you’re starting fresh, XLOOKUP is the better choice. But VLOOKUP is still widely used, and understanding it helps you read older spreadsheets.
Real-World Examples of VLOOKUP in Action
VLOOKUP is used in many scenarios:
- Employee lookup – Given an employee ID, return their department or salary.
- Inventory management – Match a product code to its stock level.
- Merging data from two lists – Combine customer names from one sheet with order totals from another.
- Grading systems – Convert a numeric score to a letter grade using a lookup table.
For example, to merge data from two sheets, you might have a list of orders on Sheet1 with customer IDs, and a customer list on Sheet2 with names. In Sheet1, you can add a column for customer name using =VLOOKUP(B2, Sheet2!$A$2:$B$100, 2, FALSE), where B2 is the customer ID on Sheet1.
Frequently Asked Questions
Why does VLOOKUP return #N/A even though the value is there?
Often it’s a formatting issue. The lookup value might be text while the table has numbers, or there are invisible spaces. Use =TRIM(A2) to remove spaces, and ensure both are the same data type. Also check that the range_lookup is FALSE.
Can VLOOKUP return multiple columns?
No, VLOOKUP returns only one value. To return multiple columns, you can use multiple VLOOKUP formulas with different column index numbers, or use XLOOKUP with a return array. For example, =XLOOKUP("P102", A2:A5, B2:C5) returns both name and price in a spill range.
Does VLOOKUP work with wildcards?
Yes, for exact match you can use wildcards in the lookup value: asterisk (*) for any sequence, question mark (?) for a single character. For example, =VLOOKUP("P*", A2:C5, 2, FALSE) finds the first entry starting with “P”. This is useful for partial matches.
How do I use VLOOKUP across different sheets?
Just reference the sheet name in the table array. For example, =VLOOKUP(A2, Sheet2!$A$2:$B$100, 2, FALSE). If the sheet name has spaces, put it in single quotes: ='My Sheet'!$A$2:$B$100.
Why is VLOOKUP returning the wrong value?
Most likely you used TRUE for range_lookup without sorting the first column. Always use FALSE for exact matches. Also check that the column index number points to the right column.
Is there a limit to how much data VLOOKUP can handle?
VLOOKUP can handle up to 1,048,576 rows in Excel, but performance may slow down with very large datasets. For millions of rows, consider using Power Query or a database, but VLOOKUP is fine for typical spreadsheet use.
Related
- Generate Random Number in Verilog: Complete Guide
- Computer System Shortcut Keys: The Essential List
- COUNTA in Google Sheets: Count Non-Empty Cells
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- JavaScript Functions Within Functions: How They WorkYes. JavaScript lets you define a function inside another function; the inner function can use variables from the…
- Filter Only Bold Text in Excel with a Helper ColumnTo filter for bold cells in Excel, add a helper column that labels each cell as Bold or…
- VLOOKUP Col Index Number: How to Use It CorrectlyThe column index number in VLOOKUP is the position of the column you want to return, counting from…
- Paste a Formula in Excel Down a Column: Step-by-StepTo paste a formula down a column in Excel, enter it in the first cell, select that cell…
- Snowflake Split by Delimiter: Functions and ExamplesTo split a string at a delimiter in Snowflake, use SPLIT(string, delimiter); it returns an array of the…
- Subtotal and COUNTIF Combined in ExcelYes, you can combine SUBTOTAL and COUNTIF in Excel, but not directly in a single formula. The standard…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.