Function · Lookup

Excel LOOKUP function

The Excel LOOKUP function finds the largest value that is less than or equal to a lookup in a list sorted ascending. A quantity of 40 in bands of 1, 10, 25, and 100 gets the 10% discount.

All current Excel versions. Also in Excel for the web and Google Sheets.

Syntax =LOOKUP(lookup_value, lookup_vector, [result_vector])

LOOKUP
=LOOKUP(40,A2:A5,B2:B5)

Arguments

NameRequiredWhat to pass
lookup_valueRequiredThe value to place among the bands.
lookup_vectorRequiredA single row or column, sorted ascending. LOOKUP has no exact-match switch.
result_vectorOptionalThe parallel row or column to return from. If omitted, the lookup vector itself is returned.

Examples

Quantity discount for 40 units

=LOOKUP(40,A2:A5,B2:B5)

Result 10%

=LOOKUP(D2,A2:A5,B2:B5)D3
Discount
ABCD
1At leastDiscountQty
210%40
3105%10%
42510%
510015%
A picture of the sheet, not a live calculator. The quantity column must stay sorted ascending. LOOKUP will not tell you if it is not.

LOOKUP, in the vector form, finds the last entry that is less than or equal to your value. The discount bands are 1, 10, 25, and 100 units. A quantity of 40 is past 25 and not yet 100, so the discount is 10%. There is no fourth argument for an exact match. This function always does the approximate search, and it trusts you to keep the lookup vector sorted ascending.

An unsorted vector returns a wrong band and does not warn you. That is the reason most new sheets should use XLOOKUP or VLOOKUP with FALSE. LOOKUP still fits a short sorted bracket, such as these quantity breaks. A value below the first band is #N/A. A value above the last band returns the last result, here 15% for any quantity of 100 or more.