
Approximate Match VLOOKUP vs. XLOOKUP: Boundary Value Traps Explained
When looking up values based on ranges, such as grading scales, pricing plans, or tax rates, VLOOKUP approximate match mode (TRUE) and XLOOKUP approximate matching can often return incorrect values at boundary values (thresholds). This article explains the principles and provides practical recipes for avoiding boundary-value traps when comparing VLOOKUP approximate match and XLOOKUP approximate match.
Quick Fix — 5 Steps to Correct Wrong Values Now
- Check table sorting: VLOOKUP approximate match (TRUE) requires ascending sort order.
- Switch to XLOOKUP:
=XLOOKUP(값, 기준, 결과, "", -1)or1. - Add a boundary safeguard: Snap values to buckets with
FLOOR.MATH/CEILING.MATH. - Check for missing ranges: Use conditional formatting to find gaps.
- Handle duplicate boundaries: Use
search_modeto choose the first or last definition.
How VLOOKUP Approximate Match Works (Why It Can Seem Wrong)
What TRUE/1 Mode and Ascending Sort Order Mean
=VLOOKUP(찾을값, 표, 열, TRUE) finds the largest value less than or equal to the lookup value. The lookup column must be sorted in ascending order.
When Boundary Values Are Missing or Duplicated
If gaps exist, values between boundaries can fall into the wrong range, and duplicate boundaries can lead to unpredictable selections.
When Data Is Mixed Up (Incorrect Sorting)
If even one row is out of order, an approximate lookup can stop at that point and return an incorrect result.
Using XLOOKUP Approximate Match Correctly (Safe Basics)
match_mode -1 vs. 1
=XLOOKUP(값, 기준범위, 결과범위, "없음", -1) // Next smaller item (≤)
=XLOOKUP(값, 기준범위, 결과범위, "없음", 1) // Next larger item (≥)
Search Direction (search_mode)
=XLOOKUP(값, 범위, 결과, , -1, 1) // Top to bottom
=XLOOKUP(값, 범위, 결과, , -1, -1) // Bottom to top
XMATCH + INDEX
=INDEX(결과범위, XMATCH(값, 기준범위, -1))
=INDEX(결과범위, XMATCH(값, 기준범위, 1))
Practical Example 1 — Grading Scale (Score to Grade)
| Minimum Score | Grade |
|---|---|
| 0 | D |
| 60 | C |
| 70 | B |
| 80 | A |
| 90 | A+ |
XLOOKUP -1: =XLOOKUP(E2, A2:A6, B2:B6, "등급없음", -1)
Bucket snap: =XLOOKUP(FLOOR.MATH(E2,1), A2:A6, B2:B6, "등급없음", -1)
Prioritize the last definition: =XLOOKUP(E2, A2:A6, B2:B6, "등급없음", -1, -1)
Practical Example 2 — Tiered Rates/Pricing Plans
| Minimum Usage | Unit Price (KRW) |
|---|---|
| 0 | 100 |
| 100 | 90 |
| 300 | 80 |
| 500 | 70 |
Rate by range: =XLOOKUP(G2, A2:A5, B2:B5, "", -1)
Tiered total: After calculating usage by tier, use =SUMPRODUCT(구간사용량범위, 단가범위)
Alternative Recipes, Precautions, and Checklist
- For out-of-range values, return “Not found” or add virtual minimum/maximum boundary rows.
- Keep tables in ascending order when possible to reduce confusion.
- [ ] Sorted in ascending order
- [ ] No missing ranges
- [ ] Duplicate-boundary handling policy
- [ ] Verify the -1/1 selection
- [ ] Apply FLOOR/CEILING
- [ ] Handle out-of-range exceptions
Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
| Off by one tier at a boundary | Incorrect match_mode selection | Select -1 or 1 again |
| Incorrect result for duplicate boundaries | Duplicates + default search direction | Use search_mode=-1 or remove duplicates |
| Wrong range returned | Incorrect sorting | Sort again in ascending order |
| Many “Not found” results | Out-of-range values or missing ranges | Add virtual boundaries or correct the ranges |
| Decimal fluctuations | No snapping applied | Apply FLOOR/CEILING |
Conclusion & Recommended Articles
The keys are sorting, continuity, duplicates, and snapping. Use XLOOKUP’s -1/1 options clearly, and use XMATCH+INDEX for transparent management when needed.
- Complete Guide to XLOOKUP with Multiple Criteria
- Guide to Multiple Conditions with the IF Function
- Calculate Range Totals with SUMIFS
- Quick Fixes for Excel Errors
- Clean Up Tables with TEXTSPLIT
Official documentation: XLOOKUP Function, VLOOKUP Function