Excel functions · Lookup
VLOOKUP function in Excel
VLOOKUP looks for a value in the first column of a table and returns the value from another column in the same row, counted from the left. It works in every version of Excel, but it can only return columns to the right of the lookup column, and it uses approximate match unless you end it with FALSE.
Last reviewed
Syntax
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])- lookup_valuerequired
- The value to find in the first column of table_array.
- table_arrayrequired
- The table to search. Its first column is the one searched.
- col_index_numrequired
- Which column of table_array to return: 1 is the first column, 2 the second, and so on.
- range_lookupoptional
- FALSE for an exact match. TRUE, or left out, finds the largest value less than or equal to lookup_value and needs the first column sorted ascending.
- Always end with FALSE unless you're matching against sorted bands such as tax or commission tiers.
- The column number is fixed, so inserting a column inside table_array can make the formula return the wrong column.
- It returns the first match only, and matching ignores case.
Which versions have VLOOKUP
Every current Excel version: Microsoft 365, Excel for the web, Excel 2024, 2021, 2019 and 2016, on Windows and Mac.
| Version | Has it |
|---|---|
| Microsoft 365 (Windows and Mac) | Yes |
| Excel for the web | Yes |
| Excel 2024 | Yes |
| Excel 2021 | Yes |
| Excel 2019 | Yes |
| Excel 2016 | Yes |
Google Sheets
Google Sheets has VLOOKUP with the same four arguments; its is_sorted argument also defaults to TRUE (approximate match), so add FALSE there too.
Examples
The examples use these sample ranges on one sheet.
| Row | A | B | C | D |
|---|---|---|---|---|
| 1 | SKU | Product | Category | Price |
| 2 | P-101 | Desk lamp | Office | 24.50 |
| 3 | P-102 | Monitor stand | Office | 39.00 |
| 4 | P-103 | USB-C hub | Electronics | 45.00 |
| 5 | P-104 | Webcam | Electronics | 69.00 |
| 6 | P-105 | Desk chair | Furniture | 189.00 |
| 7 | P-106 | Footrest | Furniture | 32.00 |
| Row | F | G |
|---|---|---|
| 1 | Sales from | Rate |
| 2 | 0 | 2% |
| 3 | 1000 | 3% |
| 4 | 5000 | 5% |
1.Exact match on a SKU
=VLOOKUP("P-104", A2:D7, 4, FALSE)Result: 69.00
Price is the 4th column of A2:D7, so VLOOKUP returns the Webcam's price.
2.Return the product name
=VLOOKUP("P-102", A2:D7, 2, FALSE)Result: Monitor stand
Column 2 of the table is Product.
3.Approximate match for tiers
=VLOOKUP(3200, F2:G4, 2, TRUE)Result: 3%
3,200 isn't in the table, so VLOOKUP takes the largest tier that's not above it (1,000) and returns its rate. The tiers must be sorted ascending.
Common errors and fixes
| Error | Why it happens | Fix |
|---|---|---|
| #N/A | No exact match: the key is missing, has extra spaces, or is a number stored as text. | Check the key, clean it with TRIM, or wrap the formula in IFERROR to show a message. |
| #REF! | col_index_num is bigger than the number of columns in table_array. | Widen table_array or lower the column number. |
| #VALUE! | col_index_num is less than 1. | Use 1 or more. |
| Wrong value, no error | range_lookup was left out, so VLOOKUP did an approximate match on unsorted data. | Add FALSE as the fourth argument. |
Do it with GPTExcel
Skip writing VLOOKUP by hand
Upload your Excel or CSV file to Chat and ask in plain English. GPTExcel writes the formula for your file and your version of Excel or Google Sheets.
Look up each customer's region from the Customers sheet and add it to my sales table.
Done. I used VLOOKUP on your sheet and checked the results against your data.
- Written for your platform and version
- Checked against your actual data
- Newest functions looked up in official docs
VLOOKUP questions
- Why does VLOOKUP return the wrong value?
- Most often the fourth argument is missing. Without FALSE, VLOOKUP does an approximate match and, on unsorted data, can return a row that isn't yours. End the formula with FALSE for an exact match.
- Can VLOOKUP look to the left?
- No. VLOOKUP only returns columns to the right of the first column of table_array. Use XLOOKUP, or INDEX with MATCH, to return a column on the left.
- Should I use VLOOKUP or XLOOKUP?
- Use XLOOKUP if everyone opening the file has Microsoft 365 or Excel 2021 or later. Use VLOOKUP, or INDEX with MATCH, when the file must work in Excel 2019 or older.
Skip the formula hunt
Upload a spreadsheet and ask in plain English. Free plan, no credit card.
Start free