LOOKUP function
Summary
Looks up values in a vector or array
Syntax
LOOKUP(lookup_value, lookup_vector, [result_vector])
The LOOKUP function vector form syntax has the following arguments:
• lookup_value Required. A value that LOOKUP searches for in the first vector. Lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.
• lookup_vector Required. A range that contains only one row or one column. The values in lookup_vector can be text, numbers, or logical values. Important: The values in lookup_vector must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP might not return the correct value. Uppercase and lowercase text are equivalent.
• result_vector Optional. A range that contains only one row or column. The result_vector argument must be the same size as lookup_vector. It has to be the same size.
• lookup_value Required. A value that LOOKUP searches for in the first vector. Lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.
• lookup_vector Required. A range that contains only one row or one column. The values in lookup_vector can be text, numbers, or logical values. Important: The values in lookup_vector must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP might not return the correct value. Uppercase and lowercase text are equivalent.
• result_vector Optional. A range that contains only one row or column. The result_vector argument must be the same size as lookup_vector. It has to be the same size.
Example
=LOOKUP(4.19, A2:A6, B2:B6)
=LOOKUP(5.75, A2:A6, B2:B6)
Looks up 5.75 in column A, matches the nearest smaller value (5.17)
=LOOKUP(7.66, A2:A6, B2:B6)
Looks up 7.66 in column A, matches the nearest smaller value (6.39)
=LOOKUP(0, A2:A6, B2:B6)
Looks up 0 in column A, and returns an error because 0 is less than the smallest value (4.14)
=LOOKUP(5.75, A2:A6, B2:B6)
Looks up 5.75 in column A, matches the nearest smaller value (5.17)
=LOOKUP(7.66, A2:A6, B2:B6)
Looks up 7.66 in column A, matches the nearest smaller value (6.39)
=LOOKUP(0, A2:A6, B2:B6)
Looks up 0 in column A, and returns an error because 0 is less than the smallest value (4.14)