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.

All current Excel versions. Also in Excel for the web and Google Sheets.

Syntax =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

VLOOKUP
=VLOOKUP(D2,A2:B6,2,FALSE)

Arguments

NameRequiredWhat to pass
lookup_valueRequiredThe value to find. It is compared with the first column of the table only.
table_arrayRequiredThe whole table, including the lookup column and the column you want back. The lookup column must be the leftmost column.
col_index_numRequiredWhich column to return, counting from 1 as the leftmost column of table_array.
range_lookupOptionalFALSE 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%

=VLOOKUP(D2,A2:B6,2,FALSE)D3
State rates
ABCD
1StateRateLookup
2CA7.25%TX
3FL6.00%6.25%
4MA6.25%
5NY4.00%
6TX6.25%
Statewide rates only, from the Tax Foundation table dated January 1, 2026. Local tax is often extra. This grid is a picture of the sheet, not a live calculator. D2 holds the letters TX.

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.