LOOKUP function
Looks up a value in a one-row or one-column range and returns the value in the same position of a second range. Expects sorted data.
Available in All versions of Excel, including Microsoft 365, Excel for the web and Excel for Mac
In every Excel versionWorks in Google Sheets
Syntax
LOOKUP(lookup_value, lookup_vector, [result_vector])| Argument | What it means | |
|---|---|---|
lookup_value | Required | The value to search for. |
lookup_vector | Required | A single row or column to search. It should be sorted in ascending order. |
result_vector | Optional | A single row or column of the same size to return from. If omitted, LOOKUP returns from lookup_vector itself. |
Returns: The value from result_vector at the position of the largest item in lookup_vector that is less than or equal to lookup_value.
How LOOKUP works
LOOKUP is one of Excel's oldest functions. It always performs an approximate match: it finds the largest value in the lookup range that is less than or equal to what you are searching for, then returns the matching position from the result range. When the lookup range is sorted and contains your exact value, that is an exact lookup; when it does not, you get the closest lower band.
Because it assumes sorted data and cannot be told to require an exact match, LOOKUP is risky for codes and names - it will quietly return a neighbouring row instead of an error. It still earns its place in two situations: quick band lookups with array constants (grades, discounts) and the famous trick that finds the last non-empty value in a column, which works because LOOKUP ignores error values while it searches.
There is also an older array form (LOOKUP(value, array)) that searches the first row or column of a rectangle; Microsoft keeps it for compatibility, but XLOOKUP, VLOOKUP or HLOOKUP are clearer for that job.
Examples
1Grade with an array constant
| A | B | C | |
|---|---|---|---|
| 1 | Student | Score | Grade |
| 2 | Lena | 73 | C |
| 3 | Omar | 91 |
Result: C
73 falls between the 65 and 80 boundaries, so LOOKUP takes the band for 65 and returns C. Copied down to C3, Omar's 91 returns A.
2Last value entered in a column
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Day | Closing stock | ||
| 2 | Mon | 140 | 125 | |
| 3 | Tue | 132 | ||
| 4 | Wed | 118 | ||
| 5 | Thu | 125 | ||
| 6 | Fri |
Result: 125
1/(B2:B6<>"") makes an array of 1s for filled cells and #DIV/0! errors for empty ones. LOOKUP searches for 2, never finds it, ignores the errors and settles on the last 1 - Thursday's 125. The figure updates as soon as Friday is typed in.
3Sorted ID list
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Emp ID | Name | Department | ||
| 2 | 1001 | Maria Lopez | Sales | IT | |
| 3 | 1002 | Tom Becker | Finance | ||
| 4 | 1003 | Aisha Khan | IT | ||
| 5 | 1004 | Luca Rossi | Sales |
Result: IT
The IDs in A2:A5 are in ascending order and 1003 exists, so LOOKUP returns the department in the same position. On unsorted data the same formula could return the wrong person.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | lookup_value is smaller than the smallest value in lookup_vector. | Add a lower bound such as 0 to the start of the lookup range. |
Wrong result, no error | The lookup range is not sorted ascending, or the exact value is missing and LOOKUP returned the next lower item. | Sort the data, or use XLOOKUP / VLOOKUP with an exact match. |
Tips
- LOOKUP has no exact-match option. Use it for bands, not for codes or names.
- The
LOOKUP(2, 1/(...), ...)pattern also works with conditions, e.g.=LOOKUP(2, 1/(A2:A100="Ana"), C2:C100)returns Ana's most recent entry. - In Microsoft 365,
=XLOOKUP(TRUE, B2:B100<>"", B2:B100, , , -1)is a more readable way to get the last value.
Google Sheets
LOOKUP also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
LOOKUP in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | VYHLEDAT |
| Danish | SLÅ.OP |
| Dutch | ZOEKEN |
| Finnish | HAKU |
| French | RECHERCHE |
| German | VERWEIS |
| Hungarian | KERES |
| Italian | CERCA |
| Norwegian (Bokmål) | SLÅ.OPP |
| Polish | WYSZUKAJ |
| Portuguese (Brazil) | PROC |
| Portuguese (Portugal) | PROC |
| Russian | ПРОСМОТР |
| Spanish | BUSCAR |
| Swedish | LETAUPP |
| Turkish | ARA |