LOOKUP finds the largest value in a sorted list that is less than or equal to your lookup value, then returns the item in the same position from a second list. It is the oldest of Excel's lookup functions, and today it is mostly used for banded lookups and for a few well-known tricks.
The two forms
Vector form: LOOKUP(lookup_value, lookup_vector, result_vector). You give one sorted row or column to search and a matching row or column to return from. The two can be in different places, and the result can sit to the left of the search column.
Array form: LOOKUP(lookup_value, array). You give one table. LOOKUP searches its first column (or its first row, if the table is wider than it is tall) and returns the item from the last column (or last row). The array form exists for compatibility with other spreadsheet programs, and Microsoft recommends VLOOKUP or HLOOKUP instead. Use the vector form.
What LOOKUP can't do
LOOKUP has no exact-match option. It always runs an approximate match, so:
- The lookup vector must be sorted ascending. On unsorted data LOOKUP can return a wrong answer with no warning.
- If the lookup value is smaller than the first item, the result is
#N/A. - If the value isn't in the list, LOOKUP does not say so. It returns the item for the closest smaller value, which can look like a valid answer. For IDs and names this is dangerous.
That makes LOOKUP a poor fit for exact lookups. Use XLOOKUP, or INDEX with MATCH and 0, or VLOOKUP with FALSE. For banded lookups, the vector form is fine, and it is a little shorter than the alternatives: =LOOKUP(A9, A2:A6, B2:B6).
Two well-known tricks
- Last number in a column:
=LOOKUP(9.99E+307, A2:A100). The huge lookup value is larger than any number you will enter, so LOOKUP lands on the last number in the range. Blanks and text are skipped. - Last match:
=LOOKUP(2, 1/(B2:B100=E2), C2:C100). Dividing 1 by the test gives 1 where the test is TRUE and #DIV/0! elsewhere. LOOKUP ignores errors, and 2 is larger than anything it finds, so it returns the last row where the test is TRUE. In Microsoft 365, XLOOKUP with search_mode -1 does the same thing more clearly.
When to use it
LOOKUP is worth knowing because you will meet it in older workbooks. For new work, prefer XLOOKUP, which can match exactly, handle unsorted data and return a message when nothing matches. Keep LOOKUP for a quick banded lookup or the last-entry tricks when the file has to open in older versions of Excel.