VLOOKUP looks down the first column of a table for a value and returns the item from another column of the same row. It is the function most people learn first, and it is in every version of Excel, so you will meet it in almost any workbook you inherit.
The four arguments
- lookup_value is what you are searching for. Point at a cell rather than typing the value.
- table_array is the block that holds both the search column and the column you want back. VLOOKUP always searches the leftmost column of this block.
- col_index_num is the position of the column to return, counted from the left of table_array. A number larger than the table is wide returns
#REF!, and a number below 1 returns #VALUE!. - range_lookup chooses the match type.
FALSE (or 0) is an exact match. TRUE, or leaving the argument out, is an approximate match.
The default is approximate
Leaving out the fourth argument means approximate match, and it is the most common VLOOKUP mistake. An approximate match assumes the first column is sorted ascending and returns the last row whose key is less than or equal to the lookup value. For sorted bands, such as score grades or commission tiers, that is what you want. On an ID list it quietly returns a wrong row with no error. For IDs, names and codes, always type FALSE.
An exact match returns the first match from the top, ignores upper and lower case, and accepts the wildcards * and ? when you look up text.
VLOOKUP, INDEX/MATCH and XLOOKUP
VLOOKUP is short, everyone can read it, and it works in every version. Its weaknesses are real, though. It can't return a column to the left of the search column. The column number is a hard-coded count, so inserting or deleting a column inside the table can change the result without any warning. And the approximate default is a trap.
INDEX with MATCH removes all three problems and also works in every version, at the cost of a longer formula. XLOOKUP does the same job in one function, with a not-found message built in, but it needs Excel 2021 or Microsoft 365.
A practical rule: if the file only opens in current Excel, use XLOOKUP. If it must open in Excel 2019 or earlier, use INDEX/MATCH, or VLOOKUP with FALSE for simple left-to-right jobs. If you keep VLOOKUP, make the column number follow the header with MATCH, as in the examples below.
Handling a missing value
An exact VLOOKUP returns #N/A when the value isn't in the first column. Wrap it in IFNA to show your own message: =IFNA(VLOOKUP(A9,A2:D7,4,FALSE),"Not listed"). Prefer IFNA to IFERROR here, because IFERROR also hides real mistakes such as a column number that is too large.