Lookup function
VLOOKUP function in Google Sheets and Excel
VLOOKUP searches the first column of a table for a value and returns the value from a column you name, on the same row.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])Arguments in [brackets] are optional. Google Sheets writes it VLOOKUP(search_key, range, index, [is_sorted]).
Example
=VLOOKUP(B2,$G$2:$J$8,4,FALSE) reads: Look for B2 in the first column of the price list $G$2:$J$8 and return the 4th column of that row (the stock), exact match only.
| A | B | C | D | E | F | G | H | I | J | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | SKU | Qty | In stock | SKU | Product | Price | Stock | ||
| 2 | 2001 | PL-104 | 2 | 12 | PL-101 | Fern | $9.50 | 40 | ||
| 3 | 2002 | PT-210 | 1 | 60 | PL-104 | Monstera | $34.00 | 12 | ||
| 4 | 2003 | TL-301 | 3 | 9 | PL-107 | Snake plant | $22.00 | 25 | ||
| 5 | 2004 | PL-101 | 1 | 40 | PT-210 | Terracotta pot | $12.50 | 60 | ||
| 6 | 2005 | SL-401 | 4 | 80 | PT-212 | Ceramic pot | $19.00 | 18 | ||
| 7 | 2006 | PL-104 | 1 | 12 | TL-301 | Watering can | $18.00 | 9 | ||
| 8 | 2007 | PT-212 | 2 | 18 | SL-401 | Potting mix | $7.25 | 80 | ||
| 9 | 2008 | PL-107 | 1 | 25 |
D2 shows 12: order 2001's SKU PL-104 is the Monstera, and the 4th column of its row in the price list is the stock, 12.
How the spreadsheet calculates it
Looks for B2 in the first column of $G$2:$J$8 and returns the value in column 4 of that row. FALSE means exact match: if the value isn't there, you get #N/A.
- 1. VLOOKUP: Looks for
B2in the first column of$G$2:$J$8and returns the value in column4of that row.FALSEmeans exact match: if the value isn't there, you get#N/A.key=`B2`: what to look fortable=`$G$2:$J$8`: the whole table, key column firstcolumn=`4`: which column to return, counting the table's first column as 1FALSE=`FALSE`: exact match. Without it VLOOKUP assumes a sorted table and can quietly return a wrong row
More VLOOKUP examples
=VLOOKUP(A2,$F$2:$H$50,3,FALSE)The third column of the table for the key in A2, exact match.=IFNA(VLOOKUP(A2,$F$2:$H$50,2,FALSE),"Missing")The same lookup with a message when the key isn't there.=VLOOKUP(D2,$G$2:$H$6,2,TRUE)A band from a sorted table of boundaries (approximate match on purpose).=VLOOKUP(B2,$G$2:$J$8,MATCH("Price",$G$1:$J$1,0),FALSE)The column found by its header, so inserted columns don't break it.
Paste any of these into the formula explainer to see it step by step.
Tips
- Always end an exact lookup with FALSE, even if it seems to work without it.
- Put the key column first in the table; if it can't be first, use XLOOKUP or INDEX MATCH instead of rearranging data.
- Lock the table with
$and widen it when you add columns, so the column number still lands where you expect.
What VLOOKUP is used for
Filling in product names and prices from a price list, pulling a department or salary band into an HR sheet, and reconciling two exports by an ID column. It's still the lookup most shared workbooks use.
Arguments
| Argument | Required | What it is |
|---|---|---|
| lookup_value | Yes | What to look for in the table's first column. |
| table_array | Yes | The table, starting with the column to search. Lock it with $ before filling down.Watch out: Unlocked, it slides down as you copy and lower rows miss their keys. |
| col_index_num | Yes | Which column of the table to return, counting the first column as 1.Watch out: A number bigger than the table's width gives #REF!. |
| range_lookup | No | FALSE for an exact match. Left out, it's TRUE: an approximate match that assumes the first column is sorted.Watch out: Leaving it out on unsorted data returns wrong rows without an error. |
Common mistakes
Leaving off
FALSE: wrong rows on an unsorted table, with no error.Forgetting
$on the table: lower rows search a shifted table and show #N/A.Counting the column from A instead of from the table's first column.
Expecting it to look left: VLOOKUP only returns columns to the right of the search column.
Inserting a column into the table, which shifts what the typed column number points at.
In Google Sheets
Google Sheets' VLOOKUP takes the same arguments. Its help also defaults the last argument (is_sorted) to TRUE, so add FALSE there too.
Errors you may see with VLOOKUP
- #N/A: The key isn't in the first column, or it differs by a space or type. How to fix it.
- #REF!: col_index_num is bigger than the number of columns in table_array.
- #SPILL!: The lookup value is a whole column like A:A in dynamic-array Excel. How to fix it.
Questions
Why does VLOOKUP return the wrong value?
Almost always a missing FALSE: approximate match on unsorted data returns a nearby row. See VLOOKUP returns the wrong value.
Can VLOOKUP use two criteria?
Not directly. Join the keys in a helper column, or use XLOOKUP or INDEX MATCH with multiplied conditions (multiple criteria).
Does VLOOKUP work across sheets?
Yes: point table_array at the other sheet, like VLOOKUP(A2, Prices!$A$2:$C$50, 3, FALSE). Keep the $ so the range doesn't move when you fill down.
Sources
Official documentation the facts on this page were checked against.