LOOKUP Function in Excel: The Old Lookup With a Famous Trick

LOOKUP Function in Excel: The Old Lookup With a Famous Trick featured illustration

📎 This article includes 1 downloadable practice file ↓

⏱ 2 min readUpdated 5 October 2026

LookupLevel: ExpertAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. LOOKUP in practice
  6. Where you will use it
  7. Worked example
  8. Mistakes people make
  9. Related functions
  10. Continue learning

LOOKUP is an older function that needs sorted data for normal use — but its array form powers the well-known “last match” trick in every version.

Advertisement

Syntax

=LOOKUP(lookup_value, lookup_vector, [result_vector])
Argument What it means
lookup_vector Must be sorted ascending for normal lookups.

Examples

Example 1

=LOOKUP(2, 1/(A2:A500=F2), C2:C500)

Last price for the product in F2 (works in old Excel without Ctrl+Shift+Enter).

Example 2

=LOOKUP(2, 1/(B:B<>""), B:B)

Last non-empty value in column B.

💡 Why 2? The 1/(condition) array contains 1s and #DIV/0! errors; LOOKUP can never find 2, so it returns the last 1 it saw — the last match.

LOOKUP in practice

Where you will use it

  • Grade from a sorted slab table
  • Last non-blank value: LOOKUP(2,1/(A:A<>""),A:A)
  • Tax slabs

Worked example

Slab rate from an illustrative slab table.

IncomeFormulaResult
350000=LOOKUP(A2,{0,400000,800000,1200000,1600000},{"0%","5%","10%","15%","20%"})0%
900000=LOOKUP(A3,{0,400000,800000,1200000,1600000},{"0%","5%","10%","15%","20%"})10%
1600000=LOOKUP(A4,{0,400000,800000,1200000,1600000},{"0%","5%","10%","15%","20%"})20%

Results calculated in Excel.

Mistakes people make

MistakeWhat to do instead
Unsorted lookup rangeLOOKUP needs ascending order
Exact matchesUse XLOOKUP for exact lookups

XLOOKUP · INDEX · MATCH

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

⚡ Interactive Practice Lab & Formula Tester:

Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.

📎 Practice files for this article

  • 📗
    Practice workbook: Lookup & reference17 tasks on realistic sales data — type your formula, the Check column turns green when it is right. Answers sheet included.
    ⬇ XLSX · 35 KB

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong

Leave a Reply

Your email address will not be published. Required fields are marked *