What is the LOOKUP function?
=LOOKUP(lookup_value, lookup_vector, [result_vector])LOOKUP searches a range sorted in ascending order for lookup_value — or, if it is not there, the largest value smaller than it — and returns the value in the same position of result_vector (vector form).
It is handy for band tables such as scores and grades. Watch on the sheet above how it goes down until it meets a larger value and then takes the value just above.
Arguments
- lookup_value
- The value to find.
- lookup_vector
- One column or row sorted in ascending order.
- result_vector
- The range to return results from. Omitted means lookup_vector.
LOOKUP examples
Example 1. Get a grade
=LOOKUP(75, A2:A6, B2:B6)The largest value up to 75 is 70, so grade "C".
Example 2. A boundary value
=LOOKUP(90, A2:A6, B2:B6)Equal to 90, so "A".
Example 3. Below the range
=LOOKUP(-5, A2:A6, B2:B6)Below 0, so #N/A.
Common mistakes
Not sorting
LOOKUP assumes the range is in ascending order. If it is not, the result is wrong.
Expecting an exact match
It returns a nearby value with no error even when there is no exact match. For exact lookups, use XLOOKUP or VLOOKUP(..., FALSE).
FAQ
- How is it different from VLOOKUP?
- It works like VLOOKUP(..., TRUE), but you choose lookup_vector and result_vector separately, so it can return values to the left too.
- Is there an array form?
- There is a LOOKUP(lookup_value, array) form, but Microsoft recommends VLOOKUP or XLOOKUP.