VLOOKUP
Search for a value in the first column of a table and retrieve data from another column in the same row.
Spreadsheet editor
Spreadsheet editor
Syntax
=VLOOKUP(lookup_value, table_array, col_index_num, range_lookup)
Returns: Varies Arguments
| Argument | Required | Description |
|---|---|---|
| lookup_value | Yes | The value to search for in the first column of the range. |
| table_array | Yes | The table of data in which to search for the lookup value. |
| col_index_num | Yes | The column number in the table from which to retrieve the value. |
| range_lookup | No | If TRUE or omitted, it finds an approximate match. If FALSE, it looks for an exact match. |
About
The function works in exact or approximate match mode. Exact matching (FALSE for the last parameter) is most common and safest for finding specific values. Approximate matching (TRUE) requires your data to be sorted and returns the closest match, useful for tax brackets or shipping rates.
For more flexible lookups, check out XLOOKUP, which can search any column and returns arrays. You can also combine INDEX with MATCH for more control over your lookups. If your data is organized horizontally instead of vertically, use HLOOKUP.
Exercises using VLOOKUP
Use VLOOKUP to find an employee’s department
BeginnerLook up an employee's department using their employee ID.
Open exerciseLookup error handling
BeginnerHandle missing lookups with IFNA for VLOOKUP and the not_found argument in XLOOKUP.
Open exerciseVLOOKUP for price
BeginnerFind a product's price from a product catalog using the product code.
Open exerciseFind a customer's city with VLOOKUP
BeginnerLook up which city a customer is located in using their customer ID and a customer directory table.
Open exerciseVLOOKUP for employee salary band
BeginnerUse VLOOKUP with an exact match to assign a salary band from a job level reference table.
Open exerciseVLOOKUP with approximate match
IntermediateCalculate shipping rate based on package weight using a tiered rate table.
Open exerciseBank statement reconciliation
AdvancedReconcile a bank statement with internal records, identify missing items.
Open exerciseCross-sheet VLOOKUP for employee data
AdvancedUse VLOOKUP with cross-sheet references to pull employee details from a master roster into a project assignment sheet.
Open exerciseFull data reconciliation
AdvancedMatch transactions between two systems, flag discrepancies by type.
Open exerciseExamples
Product lookup with exact text matching
Spreadsheet editor
Column index errors
Spreadsheet editor
Tax brackets with approximate match
Spreadsheet editor
Watch out for
Lookup value not in first column
VLOOKUP can only search the leftmost column of your table. If your lookup value is in column B and you want to return from column A, VLOOKUP won't work.
→ Rearrange your data so the lookup column is first, or use XLOOKUP which can search any column and return from any direction.
Wrong column number
Column numbers start at 1 for the first column in your range, not the spreadsheet column. Using the wrong number returns data from the wrong column or causes a #REF! error.
→ Count columns within your table_array range starting at 1. If your range is C2:F100, column C is 1, D is 2, E is 3, and F is 4.
#N/A errors from extra spaces
Lookup values fail when there are extra spaces before or after text, even though the values look identical.
→ Use TRIM on your lookup value or source data to remove extra spaces. Or wrap your lookup value: =VLOOKUP(TRIM(A2), table, 2, FALSE).
Approximate match with unsorted data
Using TRUE for range_lookup on unsorted data returns incorrect results without warning.
→ Either sort your data in ascending order by the first column, or use FALSE for exact matching. Most lookups should use FALSE unless you specifically need approximate matching for ranges.