Function · Lookup
Excel VLOOKUP function
The Excel VLOOKUP function looks down the first column of a table and returns a cell to the right. Exact match, the sort trap, and a state tax-rate example.
Syntax =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
=VLOOKUP(D2,A2:B6,2,FALSE)Arguments
| Name | Required | What to pass |
|---|---|---|
| lookup_value | Required | The value to find. It is compared with the first column of the table only. |
| table_array | Required | The whole table, including the lookup column and the column you want back. The lookup column must be the leftmost column. |
| col_index_num | Required | Which column to return, counting from 1 as the leftmost column of table_array. |
| range_lookup | Optional | FALSE or 0 for an exact match. TRUE or omitted for an approximate match, which requires the first column to be sorted ascending. |
Examples
Texas statewide sales-tax rate
=VLOOKUP("TX",A2:B6,2,FALSE)Result 6.25%
| A | B | C | D | |
|---|---|---|---|---|
| 1 | State | Rate | Lookup | |
| 2 | CA | 7.25% | TX | |
| 3 | FL | 6.00% | 6.25% | |
| 4 | MA | 6.25% | ||
| 5 | NY | 4.00% | ||
| 6 | TX | 6.25% |
VLOOKUP only searches the leftmost column of the range you give it, and it only returns a column to the right of that. The fourth argument is the one people omit. Omitted, it is TRUE, which means approximate match. On a list of state codes that is not sorted, an approximate match can hand back Florida’s rate for a state that is not even in the table.
For a code such as TX, pass FALSE. The picture uses the statewide rates as of January 1, 2026: Texas is 6.25% before any city or transit tax. The same call with WY, which is not in those five rows, returns #N/A. That is a missing row, not a zero rate. IFERROR can replace the error with the words “Add this state”. XLOOKUP can do that without the wrapper, and it can look to the left.
Inserting a column inside the table changes the column index and VLOOKUP does not notice. INDEX and MATCH, or XLOOKUP, refer to the column you want instead of a number that drifts. Keep VLOOKUP for workbooks that still have to open in older Excel.