The formula returns the last text string within the precedent range (we assume strings < 255 chars in length)
This works because:

Originally Posted by
D.O logic
a) LOOKUP assumes lookup_vector to be sorted in ascending order at all times (irrespective of reality) - and thus deems the last value to be the biggest
b) LOOKUP ignores all values within lookup_vector that are not of the same data type as the criteria
c) LOOKUP's job is to return the last value <= criteria as found in the lookup_vector (or return associated value from optional result_vector if specified)
Given all of the above:
returns apple as it LOOKUP assumes it to be the biggest string given it appears last and it is still "less" than the criteria value
The same logic can be applied to numbers we simply modify criteria from string [REPT("Z",255)] to number [9.99E+307]
Bookmarks