The LOOKUP function searches the list in_range, to find the last item that is less than or equal to value and returns the corresponding item from the list out_range.
The in_range must be sorted into ascending order (use LOOKUPEX for unsorted lists). If it isn’t, Ability may display an unexpected answer. LOOKUP works with both sorted numbers and text.
For example:
LOOKUP(3, {1, 2, 3, 4, 5}, {10, 20, 30, 40, 50}) returns 30
LOOKUP("red", {"blue", "red", "yellow"}, {3, 2, 1}) returns 2
The LOOKUP function produces the same result as combining INDEX and FIND, as follows:
INDEX(FIND(x, in_range), out_range)
See also: