SheetRocks
Documentation/Formulas/VLOOKUP

VLOOKUP

Returns a value from a table by looking up a value in the first column and returning a value from the specified column

Syntax

VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup], [value_if_not_found])

Arguments

Argument Description Required
lookup_value The value to search for in the first column of the table Required
table_array The table to search in Required
col_index_num The column number in the table to return a value from Required
range_lookup TRUE for approximate match, FALSE for exact match. Defaults to TRUE. Optional
value_if_not_found Value to return if lookup value is not found. Defaults to error. Optional

Examples

Find product price by ID

=VLOOKUP(2, A1:C3, 3, false)
Result ⇒ 19.99
A B C
1 1 Widget 9.99
2 2 Gadget 19.99
3 3 Tool 29.99

Lookup employee department

=VLOOKUP("Jane", A1:B3, 2, false)
Result ⇒ Marketing
A B
1 John Sales
2 Jane Marketing
3 Bob IT

Grade lookup with approximate match

=VLOOKUP(85, A1:B4, 2, true)
Result ⇒ B
A B
1 60 D
2 70 C
3 80 B
4 90 A

Three arguments (defaults to approximate match)

=VLOOKUP(25, A1:B3, 2)
Result ⇒ Medium
A B
1 10 Small
2 20 Medium
3 30 Large

Custom value when not found

=VLOOKUP("Z", A1:B3, 2, false, "Not Found")
Result ⇒ Not Found
A B
1 A Alpha
2 B Beta
3 C Charlie

Related Functions

Other Data functions:


← Back to Formula Reference