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:

A1:A5 = Region names (down the side). B1:F1 = Month names (across the top). B2:F5 = the actual sales grid. =XLOOKUP(H1, A2:A5, XLOOKUP(H2, B1:F1, B2:F5)) 1. H1 → the Region typed by the user (e.g. "North") 2. A2:A5 → search the Region column for it 3. XLOOKUP(H2, B1:F1, B2:F5) → the RETURN range isn't fixed — it's itself another XLOOKUP, which finds H2's month (e.g. "March") across B1:F1 and returns that entire COLUMN from B2:F5

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:

A2:A5 (sorted ascending) = 0, 1000, 5000, 20000 — tier thresholds B2:B5 = "Bronze", "Silver", "Gold", "Platinum" =XLOOKUP(D1, A2:A5, B2:B5, "No tier", -1) The 5th argument, -1, means: "if there's no exact match, use the largest value that's still less than or equal to D1" — i.e. find which tier threshold D1 has reached, not exceeded. D1 = 6500 → matches the "5000" tier → returns "Gold"

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.

Data Validation Source field for the Subcategory dropdown (cell B2): =FILTER(Subcats[Name], Subcats[Category]=A2) → A2 holds whatever Category was picked in the first dropdown; this list automatically narrows to match it
Lookup needTool
One key, one exact answerPlain 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 tiersXLOOKUP with match mode -1 (or 1)
Restricting what a user can typeData Validation → List
A dropdown whose options depend on another cellData Validation → List, sourced from a FILTER formula
A FILTER-sourced dropdown updates itself as the underlying data changes
Because the dependent dropdown's source is a live 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.
A dropdown sourced from a spill range needs the # operator, not just the first cell
Setting a dropdown's Source field to a single cell like 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

Exercise 1

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 solution
Exercise 2

A2: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 solution
Exercise 3

A 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 solution

Chapter 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