← All how-to recipes

How to look up the closest match (tax brackets, tiers, grades)

✓ Verified in LibreOffice 25.8.7.3

Find which bracket or tier a value falls into — the largest threshold that doesn't exceed it.

The formula

AppFormulaNotes
Excel=INDEX(B2:B5,MATCH(D2,A2:A5,1))Thresholds in A2:A5 must be sorted ascending. XLOOKUP(D2,A2:A5,B2:B5,,-1) needs no sorting logic change.
Google Sheets=INDEX(B2:B5,MATCH(D2,A2:A5,1))Identical; VLOOKUP(D2,A2:B5,2,TRUE) is the classic equivalent.
LibreOffice Calc=INDEX(B2:B5,MATCH(D2,A2:A5,1))Identical.

How it works

MATCH with type 1 finds the LAST threshold ≤ the value in an ascending list — 120 clears the 100 tier but not 200, so the answer is "Gold". This is exactly how tax brackets, commission tiers, shipping bands, and letter grades work, and it's why the thresholds list the BOTTOM of each band. The classic VLOOKUP-with-TRUE does the same; unsorted data silently returns wrong answers, which XLOOKUP's -1 match mode avoids.

Verified, not just documented

We ran =INDEX(B2:B5,MATCH(D2,A2:A5,1)) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned Gold — exactly the expected result. Every formula here is confirmed by actually executing it.