LOOKUP Function in Excel

Sumit Bansal
Written by

Sumit Bansal is the founder of TrumpExcel.com and a 13-time Microsoft Excel MVP. He started this site in 2013 to share his passion for Excel through easy tutorials, tips, and training videos, helping you master Excel, boost productivity, and maybe even enjoy spreadsheets!

If you want to find a value in a sorted row or column and pull back the matching item next to it, the LOOKUP function does exactly that.

It hunts for your value, and when there’s no exact hit, it settles on the largest value that isn’t bigger than what you asked for.

In Excel 365, you can also hand LOOKUP a whole range of lookup values and the answers spill into the cells below.

In this article, I’ll show you how to use LOOKUP with practical examples, covering both its vector and array forms.

Follow along with the example file

LOOKUP Function Excel.xlsx

Download

LOOKUP Syntax

LOOKUP comes in two forms. Here is the vector form, which is the one you’ll use most:

=LOOKUP(lookup_value, lookup_vector, [result_vector])
  • lookup_value – the value you want to find. This can be a number, text, a logical value, or a cell reference.
  • lookup_vector – a single row or column, sorted in ascending order, that LOOKUP searches through.
  • result_vector – optional. A single row or column holding the values you want returned. Leave it out and LOOKUP returns from lookup_vector itself.

LOOKUP has no exact-match-only switch. It returns an exact hit when there is one, otherwise the largest value less than or equal to your lookup value.

That makes it a quick way to find the closest match in a sorted list. For exact matching on unsorted data, use XLOOKUP instead.

Make sure result_vector has the same number of cells as lookup_vector. Absolute references stop one range from drifting when you copy the formula.

Also note that LOOKUP is case-insensitive. It can’t tell apart codes that differ only by letter case, so “AB10” and “ab10” look identical to it.

And here is the array form, which packs the search values and return values into one range:

=LOOKUP(lookup_value, array)
  • array – a block of cells. If it’s wider than it is tall, LOOKUP searches the first row and returns from the last row. If it’s square or taller than wide, it searches the first column and returns from the last column.

LOOKUP works in Excel for Microsoft 365, Excel 2024, 2021, 2019, and 2016, plus Excel on the web. It’s a longstanding function, so you’ll find it in older workbooks too.

You can also check Microsoft’s LOOKUP function reference for the official argument rules.

When to Use the LOOKUP Function

Use LOOKUP when you need to:

  • Map one or many values to bands in a small lookup vector that’s sorted in ascending order.
  • Pull an as-of value from a vertical column pair or a horizontal row pair, where approximate matching is what you actually want.
  • Keep older workbooks running, including the legacy array form and the classic last-value trick.
  • Grab the final non-blank entry or the last matching record with the LOOKUP(2,1/(condition),result) pattern when backward compatibility matters.

LOOKUP vs VLOOKUP vs XLOOKUP

All three find a value and return something related to it, but they don’t behave the same way. Here’s a quick comparison:

LOOKUPVLOOKUPXLOOKUP
Match typeApproximate only (exact when it finds one)Exact or approximateExact by default, approximate optional
Needs sorted dataYes, ascendingOnly for approximate matchNo
Where it returns fromAny row or column you point toOnly columns to the rightAny row or column you point to
When nothing matches#N/A#N/AYour own message or value
Search from the bottomOnly with the 2,1/ trickNoYes
Available inAll versionsAll versionsExcel 365, 2021 and later

LOOKUP is short and works in every version, but it quietly assumes your data is sorted.

For new work, I’d go with XLOOKUP when your Excel version and the people you share files with allow it.

When the file has to open in older Excel, VLOOKUP or HLOOKUP is the safer pick.

This breakdown of the difference between VLOOKUP and XLOOKUP covers that pair in detail.

Let me show you a few practical examples of how LOOKUP works.

Example 1: Assign Grades to Multiple Scores at Once

Let’s start with a spilling example, since that’s how you’ll most likely use LOOKUP in Excel 365.

Below is a simple grading table. The ascending score thresholds sit in A2:A6, with the matching grade in B2:B6. In E2:E7, I have the scores of six students.

Score thresholds with grades in columns A and B, and six students with their scores in columns D and E

I want the right grade for every single student, all from one formula.

Here is the formula:

=LOOKUP(E2:E7,$A$2:$A$6,$B$2:$B$6)
LOOKUP formula in F2 spilling a grade for every student score

Because I fed LOOKUP the whole range E2:E7, it returns six answers that spill down the cells below. You type it once and Excel fills the rest.

For each score, LOOKUP finds the largest threshold that doesn’t go over it.

Tariq’s 48 lands on the 35 threshold and returns “Pass”, while Hannah’s 33 falls back to the 0 row and returns “Fail”.

Important: Sort the searched column in ascending order. If it isn’t sorted, LOOKUP can hand you a believable but wrong answer, with no error to warn you.

Also, if a score were smaller than the smallest threshold, LOOKUP would return #N/A. That’s why the table starts at 0.

In your own data, only wrap LOOKUP in IFNA when a below-minimum fallback actually makes sense.

Pro Tip: The spilling form needs Excel 365, Excel 2021 or later, or Excel for the web. In Excel 2019 or earlier, put =LOOKUP(E2,$A$2:$A$6,$B$2:$B$6) in F2 and copy it down.

Example 2: Look Up a Value Across a Row

Here’s another scenario, this time with data running sideways.

A gym revises its monthly fee every few months. The dates when each new fee started run across B1:G1, with the fee sitting right below in B2:G2.

In B5:B9, I have the join dates of five members.

Gym fee start dates across row 1 with monthly fees in row 2, and member join dates below

I want the fee that was active on each member’s join date, pulled from those horizontal rows.

Here is the formula:

=LOOKUP(B5:B9,$B$1:$G$1,$B$2:$G$2)
LOOKUP formula in C5 returning the fee in force on each member's join date

LOOKUP searches the start dates in B1:G1 for each join date, then returns the fee from the matching spot in B2:G2.

Tom joined on August 1, 2026. That lands on the July 15, 2026 revision, so he gets a fee of 35.

Notice that the source rows run horizontally, but the results still spill down a vertical list. The orientation of your lookup values decides the spill direction.

In Excel 2019 or earlier, enter =LOOKUP(B5,$B$1:$G$1,$B$2:$G$2) in C5 and copy it down instead.

Example 3: Use the Array Form of LOOKUP

Now let’s look at the array form, which handles the search and the return in a single range.

Below is a bulk-order discount table. Order quantities run in ascending order down column A, the delivery days sit in column B, and the discount is in column C.

The order quantity I want to check is in cell B9.

Bulk order discount table with order quantity, delivery days, and discount, plus an order quantity of 250 in B9

I want the discount for the quantity in B9, using the two-argument array form.

Here is the formula:

=LOOKUP(B9,A2:C7)
Array form LOOKUP formula in B10 returning a 15% discount for 250 units

The range A2:C7 is taller than it is wide, so LOOKUP searches down the first column and returns from the last column.

An order of 250 lands on the 200 row and returns 15%.

The middle column, delivery days, is completely ignored.

The array form only ever uses the first and last columns of a tall range, so anything in between is just along for the ride.

Pro Tip: Microsoft keeps the array form mainly for old workbooks. For a new file, XLOOKUP is clearer, since you name the search and return columns directly.

Example 4: Get the Last Value in a Column

This next one is a handy trick for logs that keep growing.

I have a simple weight tracker with dates in column B and daily weights in C2:C11. It’s filled in through Day 7, and the rows below are still blank, waiting for future days.

Weight log with dates for ten days and weights recorded through Day 7

I want the last weight that’s actually been recorded, without hunting down the bottom row by hand every time.

Here is the formula:

=LOOKUP(2,1/(C2:C11<>""),C2:C11)
LOOKUP formula returning the last recorded weight of 81.0

How this formula works:

  • C2:C11<>”” checks each cell for content and builds an array of TRUE and FALSE values.
  • 1/(…) turns every TRUE into 1 and every FALSE into a #DIV/0! error.
  • LOOKUP(2, …) searches that array for 2. Since 2 is never found and LOOKUP skips the errors, it settles on the last 1, which is the final cell that has a value.
  • LOOKUP then returns the weight from C2:C11 in that same position, which gives you 81.0.

Notice this returns a single value, not a spill. The condition builds an array internally, but LOOKUP still hands back only that one last item.

Point this formula at a real range like C2:C11 rather than a whole column, so it doesn’t calculate more cells than it needs to.

If your list holds only numbers, here’s another way to get the last number in a list.

Example 5: Find the Last Matching Record

Let’s build on that trick to pull the most recent record for one specific person.

I have a library loan log. The loan dates are in column A, member names in B2:B13, and the book borrowed in C2:C13. The member I want to check is in cell E2.

Library loan log with loan dates, member names, and books, with Aisha entered in E2

The same member shows up several times in the log, and I want the last book they borrowed.

Here is the formula:

=LOOKUP(2,1/(B2:B13=E2),C2:C13)
LOOKUP formula returning Wuthering Heights as the last book Aisha borrowed

The condition B2:B13=E2 marks every row for Aisha as TRUE. Dividing 1 by that gives a 1 for each matching row and a #DIV/0! everywhere else.

LOOKUP hunts for 2, never finds it, and lands on the last 1, which is Aisha’s final loan. It then returns the book from C2:C13 in that spot, Wuthering Heights.

The same idea, tweaked a little, also lets you lookup the second or Nth value when you need something other than the last match.

I’ve also covered a few other ways to find the last occurrence of a lookup value, including a MAX-based formula and a VBA option.

Pro Tip: In Excel 365 or 2021, =XLOOKUP(E2,B2:B13,C2:C13,,0,-1) does the same job. The -1 tells XLOOKUP to search from the bottom up.

Example 6: Match on Two Conditions

Let’s finish with a tougher case: matching on more than one condition.

I have a grocery price log. The store is in B2:B13, the item in C2:C13, and the price paid in D2:D13. The store and item I care about are in G2 and G3.

Grocery price log with date, store, item, and price, plus FreshCo and Eggs entered as the criteria

I want the latest price for the row that matches both the selected store and the selected item.

Here is the formula:

=LOOKUP(2,1/((B2:B13=G2)*(C2:C13=G3)),D2:D13)
LOOKUP formula returning $3.69 as the latest FreshCo eggs price

How this formula works:

  • (B2:B13=G2) and (C2:C13=G3) each build a TRUE/FALSE array, one for the store and one for the item.
  • Multiplying them gives 1 only where both are TRUE, since TRUE times TRUE is 1 and anything with a FALSE becomes 0.
  • 1/(…) turns those 1s into 1 and the 0s into #DIV/0! errors.
  • LOOKUP(2, …) settles on the last 1, so you get the price from the most recent row that matches both conditions.

Here that’s $3.69, from the May 30 FreshCo eggs row. It skips the later Corner Mart eggs and FreshCo bread rows, since each of those matches only one condition.

Keep in mind this returns one value, the latest match. If you want every matching row instead, FILTER is the cleaner route in Excel 365.

And for just the latest match in Excel 365 or 2021, =XLOOKUP(1,(B2:B13=G2)*(C2:C13=G3),D2:D13,,0,-1) reads more plainly.

If you’re working with VLOOKUP, here’s how to use VLOOKUP with multiple criteria.

LOOKUP is a handy way to match a value against a sorted list and pull back the item beside it, whether your data runs down a column or across a row.

It’s still worth knowing, both for older files and for those compact last-match and approximate-match jobs.

I hope you found this tutorial helpful.

List of All Excel Functions

Other Excel Articles You May Also Like:

Sumit Bansal

Sumit Bansal

13x Microsoft Excel MVP

Hey! I'm Sumit Bansal, founder of trumpexcel.com and a Microsoft Excel MVP. I started this site in 2013 because I genuinely love Microsoft Excel (yes, really!) and wanted to share that passion through easy Excel tutorials, tips, and Excel training videos. My goal is straightforward: help you master Excel skills so you can work smarter, boost productivity, and maybe even enjoy spreadsheets along the way!

Get the FREE 51 Excel Tips Ebook

Enter your details and the free PDF is on its way to your inbox.

Hmm, that didn't go through. Please check your email and try again.

No spam. You'll also get my weekly Excel newsletter. Unsubscribe anytime.

Check your inbox!

The ebook is on its way to your email. It usually lands within a couple of minutes.