Google Sheets function · Lookup
VLOOKUP in Google Sheets: syntax and examples
VLOOKUP searches the first column of a range for a key and returns the value from another column in the same row. Use FALSE as the last argument for codes, emails and IDs, where only an exact match makes sense.
Syntax
VLOOKUP(search_key, range, index, [is_sorted])
Arguments
| Argument | Type | Required | What it does |
|---|---|---|---|
search_key | any | yes | The value you look for. It is compared with the first column of range only. |
range | range | yes | The table to search. The key column must be its leftmost column. |
index | number | yes | Which column of range to return, counted from 1 at the key column. |
is_sorted | boolean | no | FALSE for an exact match. TRUE, or leaving it out, means approximate match on a sorted first column. |
Examples
The examples use this table, starting in A1:
| SKU | Product | Price | Stock |
| A-100 | Desk lamp | 79.9 | 12 |
| A-200 | Office chair | 549 | 0 |
| B-300 | Monitor stand | 129.5 | 7 |
| B-400 | Cable tray | 34 | 40 |
=VLOOKUP("B-300", A2:D5, 3, FALSE)Result: 129.5
Price of one SKU. FALSE forces an exact match, which is what you want for codes.
Run in a Google Sheet (English US locale) on .
=VLOOKUP("A-200", A2:D5, 4, FALSE)Result: 0
Stock for a SKU: same table, fourth column.
Run in a Google Sheet (English US locale) on .
=IFERROR(VLOOKUP("C-999", A2:D5, 2, FALSE), "not found")Result: not found
A code that is not in the table. IFERROR replaces #N/A with your own text.
Run in a Google Sheet (English US locale) on .
=ARRAYFORMULA(VLOOKUP({"A-100"; "B-400"}, A2:D5, 3, FALSE))Result:
| 79.9 |
| 34 |
Several keys at once: ARRAYFORMULA returns one price per key, one under the other.
Run in a Google Sheet (English US locale) on .
=VLOOKUP("b-300", A2:D5, 2, FALSE)Result: Monitor stand
Lowercase key, uppercase data: the match ignores case, so it still finds the row.
Run in a Google Sheet (English US locale) on .
Common errors
- It only looks to the right. If the key sits in column B and range starts at A, you get #N/A. Start range at the key column, or use XLOOKUP or INDEX with MATCH.
- An index larger than the number of columns in range returns #REF!, for example 5 on a four-column table.
- Leaving out is_sorted means TRUE: approximate match on a sorted column. On unsorted data it returns a wrong row without any error, so write FALSE explicitly.
- A number stored as text ("100") does not match the number 100. Clean the column with VALUE or TO_TEXT so both sides have the same type.
Compared with Excel
Same syntax as Excel VLOOKUP. Excel 365 also has XLOOKUP, which Google Sheets has too.
Questions and answers
Why does VLOOKUP return #N/A when the value is clearly there?
Usually the key is not in the first column of range, there are trailing spaces, or one side is a number and the other is text. TRIM and VALUE fix the last two.