ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. XLOOKUP Approximate Match: Next Smaller or Larger

XLOOKUP Approximate Match: Next Smaller or Larger

By ExcelReady Team·Updated November 1, 2026·6 min read

The short answer

For an approximate match in XLOOKUP, set the fifth argument, match_mode. Use -1 to return the exact value or the next smaller one, as in =XLOOKUP(B2,D2:D5,E2:E5,,-1) for commission tiers. Use 1 for the exact value or the next larger one, such as shipping weight limits. Unlike VLOOKUP's approximate match, the list doesn't need to be sorted.

Key takeaways

  • match_mode is XLOOKUP's fifth argument: 0 exact (the default), -1 exact or next smaller, 1 exact or next larger.
  • Use -1 when your table lists lower limits, like "from 10,000 sales"; use 1 when it lists upper limits, like "up to 5 kg".
  • An exact match always wins, so a value equal to a threshold returns that row.
  • Leave the fourth argument empty with two commas, or put a not-found message there.
  • XLOOKUP's approximate modes work on unsorted lists; VLOOKUP's approximate match needs ascending order.
On this page+
  1. What match_mode does in XLOOKUP
  2. Next smaller (-1): tiers that start at a lower limit
  3. Next larger (1): limits that say "up to"
  4. Add a message for values outside the table
  5. XLOOKUP vs VLOOKUP approximate match
  6. Speed up big lookups with search_mode
  7. Common mistakes with XLOOKUP approximate match
  8. Practise it

An XLOOKUP approximate match finds the closest value when there is no exact one, using the fifth argument, match_mode. Set it to -1 for the exact value or the next smaller one, or to 1 for the exact value or the next larger one. This guide shows when to use each, with a commission tier table and a shipping rate table, and how it compares with VLOOKUP's approximate match.

XLOOKUP needs Excel 2021, Excel 2024, Microsoft 365 or Excel for the web. If you haven't used it yet, read the XLOOKUP guide for beginners first.

What match_mode does in XLOOKUP#

match_mode tells XLOOKUP what to do when the exact value isn't in the list. It is the fifth argument:

Excel formula
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
match_modeWhat XLOOKUP returns
0 (default)Exact match only, otherwise #N/A
-1Exact match, or the next smaller item
1Exact match, or the next larger item
2Wildcard match with *, ? and ~

Modes -1 and 1 are the approximate ones. In both, an exact match always wins. Only when the exact value is missing does XLOOKUP move to the nearest item in the direction you chose. Wildcard mode 2 is covered in XLOOKUP wildcards and match modes.

Next smaller (-1): tiers that start at a lower limit#

Use -1 when your table lists the starting point of each band. Commission tiers are a classic example:

DE
1Min SalesRate
202%
310,0004%
425,0006%
550,0008%

Each row means "from this amount up". A rep who sold 32,000 is past the 25,000 line but hasn't reached 50,000, so she earns 6%. With her sales in B2:

Excel formula
=XLOOKUP(B2,D2:D5,E2:E5,,-1)

XLOOKUP looks for 32,000, doesn't find it, and takes the next smaller value, 25,000. The result is 6%. The two commas leave the fourth argument, if_not_found, empty.

SalesNext smaller limitRate
8,50002%
32,00025,0006%
50,00050,000 (exact)8%

The row for 0 matters. Without it, sales of 8,500 would have no next smaller value and XLOOKUP would return #N/A. The same pattern handles tax brackets and grade bands; see tax bracket and tier lookups for a full worked example.

Next larger (1): limits that say "up to"#

Use 1 when your table lists the upper limit of each band. Shipping rates often work this way:

DE
1Up to (kg)Cost
214.00
357.00
41012.00
52020.00

A 6.5 kg parcel is too heavy for the 5 kg band, so it goes in the "up to 10 kg" band. With the weight in B2:

Excel formula
=XLOOKUP(B2,D2:D5,E2:E5,,1)

XLOOKUP takes the next larger value, 10, and returns 12.00. A parcel of exactly 5 kg matches the 5 row and costs 7.00.

To pick the right mode, read your table's first column aloud. If it says "from", use -1. If it says "up to", use 1.

Add a message for values outside the table#

Approximate modes still return #N/A when there is nothing in the chosen direction. With -1, that happens below the smallest value. With 1, it happens above the largest. A 25 kg parcel is heavier than every limit in the shipping table, so:

Excel formula
=XLOOKUP(B2,D2:D5,E2:E5,"Quote needed",1)

returns Quote needed instead of #N/A. The message goes in the fourth argument, before the match mode. More options are in XLOOKUP if not found.

XLOOKUP vs VLOOKUP approximate match#

VLOOKUP's approximate match (TRUE, or a blank fourth argument) behaves like XLOOKUP's -1, with two important limits:

XLOOKUPVLOOKUP
Next smallermatch_mode -1range_lookup TRUE
Next largermatch_mode 1Not available
Needs sorted dataNo (default search)Yes, ascending
Default when left outExact matchApproximate match

The sorting point is the big one. If a VLOOKUP tier table isn't sorted smallest to largest, VLOOKUP can return a wrong rate with no error at all. XLOOKUP's default search checks every row and finds the true nearest value, so a shuffled table still gives the right answer. The comparison of INDEX MATCH vs XLOOKUP covers the same idea for MATCH, whose type 1 and -1 also need sorted data.

You may still want to sort the table anyway, because it is much easier for people to read.

Speed up big lookups with search_mode#

The sixth argument, search_mode, can switch to a binary search. Modes 2 and -2 search a sorted list very quickly, which helps on tens of thousands of rows. They need the list sorted ascending (2) or descending (-2), and give wrong results if it isn't. For normal-sized tables, leave search_mode out.

search_mode -1 searches from the bottom up, which is how you find the most recent entry rather than the first one. The guide to looking up the last match shows that technique.

Common mistakes with XLOOKUP approximate match#

  1. Wrong direction. Using 1 on a "from" table shifts every result up one band. Check one value that falls between two limits by hand.
  2. Missing the bottom or top row. A -1 table needs a 0 row; a 1 table needs a row large enough for every value.
  3. Too few commas. =XLOOKUP(B2,D2:D5,E2:E5,-1) puts -1 in the if_not_found slot, so you get an exact match. You need two commas: ,,-1.
  4. Text numbers in the table. Limits stored as text never compare as numbers. Convert them first.

For the full list of arguments, see the XLOOKUP function guide.

Practise it#

Tier lookups come up in finance and operations job tests all the time. Practise XLOOKUP match modes in a live spreadsheet: you type the formula, choose -1 or 1, and it checks the result instantly. When you're ready, try the finance Excel mock test to use it under time pressure.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Jade sold 32,000. In C2, use XLOOKUP with match mode -1 to find her commission rate from the tier table in D2:E5. Leave the fourth argument empty: ,,-1.

fx
ABCDEF
1
Rep
Sales
Rate
Min Sales
Rate
2
Jade
32000
0
0.02
3
Omar
8500
10000
0.04
4
Lucia
50000
25000
0.06
5
50000
0.08
6
7
8

Tip: Lookup value B2, look in D2:D5, return E2:E5, then two commas and -1 for exact or next smaller.

Practise this in a lesson

LessonXLOOKUP wildcards and match modesSearch partial names with XLOOKUP's wildcard mode, and place values into tiers with next-smaller and next-larger matches.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.

Frequently asked questions

How do I do an approximate match with XLOOKUP?

+

Add a fifth argument, match_mode. Use -1 for the exact value or the next smaller one, or 1 for the exact value or the next larger one. For example, =XLOOKUP(B2,D2:D5,E2:E5,,-1).

Does XLOOKUP approximate match need sorted data?

+

No. With the default search mode, match_mode -1 and 1 find the closest value in an unsorted list. Only the binary search modes, 2 and -2, need sorted data.

What is the XLOOKUP equivalent of VLOOKUP TRUE?

+

Match mode -1. VLOOKUP with TRUE returns the largest value that is less than or equal to the lookup value, which is what XLOOKUP does with -1.

Why does XLOOKUP approximate match return #N/A?

+

With -1, the lookup value is smaller than every value in the list, so there is no next smaller item. With 1, it is larger than every value. Add a bottom row such as 0, or a not-found message.

Sources

  • XLOOKUP function - Microsoft Support
  • VLOOKUP function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What match_mode does in XLOOKUP
  2. Next smaller (-1): tiers that start at a lower limit
  3. Next larger (1): limits that say "up to"
  4. Add a message for values outside the table
  5. XLOOKUP vs VLOOKUP approximate match
  6. Speed up big lookups with search_mode
  7. Common mistakes with XLOOKUP approximate match
  8. Practise it

Keep reading

Lookups· 7 min read

Find the Last Match in Excel With XLOOKUP

To find the last match, set XLOOKUP's sixth argument, search_mode, to -1 so it searches from the bottom up: =XLOOKUP(F2,A2:A8,C2:C8,"Not found",0,-1). It returns the value from the last row where column A equals F2, such as the most recent price in a list sorted oldest first. XLOOKUP needs Excel 2021 or Microsoft 365.

Lookups· 6 min read

XLOOKUP Wildcards and Match Modes Explained

XLOOKUP uses wildcards only when its 5th argument, match_mode, is 2: =XLOOKUP("Riverside*",A2:A9,B2:B9,"Not found",2). The * stands for any number of characters and ? for exactly one. Match mode -1 returns an exact match or the next smaller value, and 1 the next larger, which is useful for bands and tiers.

Lookups· 7 min read

XLOOKUP in Excel: Everything a Beginner Needs

XLOOKUP finds a value in one range and returns the matching item from another: =XLOOKUP(G2,B2:B9,A2:A9). It defaults to an exact match, can return a column on either side, and has a built-in if_not_found message instead of #N/A. It needs Excel 2021, Excel 2024 or Microsoft 365; it isn't in Excel 2019 or earlier.

More on lookups

  • XLOOKUP If Not Found: Show a Message Instead of #N/A
  • XMATCH Function in Excel: Find a Position
  • How to Compare Two Lists in Excel
  • How to Fix #N/A Errors in VLOOKUP and XLOOKUP
  • HLOOKUP in Excel (and When to Use It)
  • INDEX Function in Excel: Return a Value by Position
All lookups articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free