Advanced Lookups & Data Validation
Excel Advanced
Chapter 2 · Advanced Lookups & Data Validation
Excel Fundamentals Chapter 5 used XLOOKUP for the simplest possible case: one key, one exact match, one answer. Real spreadsheets often need more — finding a value at the intersection of two keys, matching against a tier rather than an exact value, or restricting what a user is even allowed to type into a cell in the first place. This chapter covers all three, and closes with dropdown lists that stay in sync with live data automatically, using Chapter 1's own dynamic arrays.
Nested XLOOKUP: Looking Up in Two Dimensions
Imagine a grid with Regions down the side and Months across the top, each intersection holding that region's sales for that month. Finding "North region, March" needs two lookups at once — one to find which row, one to find which column — and XLOOKUP can nest inside itself to do both in one formula:
Read this from the inside out, the same way Chapter 1 taught you to read nested dynamic arrays: the inner XLOOKUP resolves first, turning "March" into the single column of sales figures for March. The outer XLOOKUP then searches that one column (not the whole grid) for the row matching "North," landing on exactly one cell — the intersection of both keys.
Approximate-Match XLOOKUP for Tiered Lookups
Excel Fundamentals Chapter 4 built a 4-band nested IF chain to sort a value into a grading band. For a genuinely long list of tiers (a commission structure, a tax bracket table), a long nested IF chain becomes unwieldy. XLOOKUP's optional 5th argument, match mode, offers a cleaner alternative:
This single formula replaces what would otherwise be a nested IF chain with one entry per tier — and unlike that nested chain, adding a new tier here means adding one row to the reference table, not editing the formula's own logic at all.
Data Validation: Basic Dropdown Lists
Data → Data Validation, with "Allow" set to List, restricts what can be typed into a cell to a fixed set of choices, shown as a dropdown arrow next to the cell. The source can be a typed, comma-separated list, or — far more maintainable — a reference to a range:
- Typed directly:
Bronze,Silver,Gold,Platinum - Referencing a range: point the Source field at
Budget[Category](Chapter 7's structured reference) — the dropdown then automatically includes any new category added to the Budget table, with zero maintenance on the dropdown itself.
Dependent Dropdowns: A Second List That Reacts to the First
A dependent dropdown is a second Data Validation list whose available choices change based on what's selected in a different cell — a Subcategory list that only shows subcategories belonging to whichever Category was picked. Chapter 1's FILTER makes this straightforward: set the second dropdown's Source to a formula that filters the full subcategory list down to just the ones matching the first dropdown's current selection.
| Lookup need | Tool |
|---|---|
| One key, one exact answer | Plain XLOOKUP (Excel Fundamentals Chapter 5) |
| Two keys (a row key and a column key) | XLOOKUP nested inside XLOOKUP |
| One key, matched against a sorted list of tiers | XLOOKUP with match mode -1 (or 1) |
| Restricting what a user can type | Data Validation → List |
| A dropdown whose options depend on another cell | Data Validation → List, sourced from a FILTER formula |
FILTER formula rather than a fixed, manually-typed list, adding a new subcategory to the Subcats table makes it available in the dropdown immediately, for whichever category it belongs to — with no dropdown settings ever needing to be touched again, the exact same "maintain the data, not the dropdown" principle Chapter 1's UNIQUE and FILTER already established.
D2 when D2 actually holds a spilling formula only offers ONE choice — the formula's first result — not the full list. The Source must reference the entire spill range with D2# for every spilled value to appear as a choice. Forgetting the # is easy to miss, since the dropdown still works, it just silently offers far fewer options than intended.
Hands-On Exercises
A2:A5 lists Regions (North, South, East, West), B1:E1 lists Quarters (Q1, Q2, Q3, Q4), and B2:E5 holds a sales grid — so row 2 is North's data, row 3 is South's, and so on, lining up with A2:A5. Write a nested XLOOKUP formula that returns the sales figure for "South" region, "Q3" quarter, given those two values typed into G1 and G2. Trace through which lookup resolves first and why.
📄 View solutionA2:A5 (sorted ascending) holds commission thresholds 0, 2000, 8000, 15000, with B2:B5 holding rates 2%, 4%, 6%, 8%. Write an XLOOKUP formula using approximate match to find the correct commission rate for a sales figure of 9500 in cell D1. State the exact rate returned and explain why match mode -1 (not 0) is required here.
📄 View solutionA dropdown's Data Validation Source field is set to just "D2", where D2 holds the formula =UNIQUE(A2:A20), currently spilling into D2:D6. Describe exactly what the dropdown will show, why, and what single change to the Source field fixes it.
📄 View solutionChapter 2 Quick Reference
- Two-dimensional lookup: nest XLOOKUP inside XLOOKUP's return-range argument — the inner one resolves first, its result becomes the outer's search range
- Tiered lookup: XLOOKUP's 5th argument, match mode -1, finds the nearest threshold not exceeded — a clean alternative to a long nested IF chain
- Data Validation → List restricts input to a fixed set; source a real range (or Table column) instead of typing values by hand
- Dependent dropdown: source the second list from a FILTER formula referencing the first dropdown's cell
- A dropdown sourced from a spilling formula needs D2#, not just D2, or it only offers the first spilled value