XLOOKUP with Multiple Criteria
Return one value where several fields match on the same row by multiplying Boolean criteria arrays, looking up the resulting 1, and checking that the combined key is unique.
| XLOOKUP with Multiple Criteria, Formula Review | ||||||||||||
| Turn scenario and year tests into one lookup array, then reconcile to INDEX and MATCH. | ||||||||||||
| Scenario-year assumptions and visible flags | Criteria and formula review | |||||||||||
| Scenario | Year | Revenue growth | Scenario flag | Year flag | Combined flag | Scenario criterion | Upside | |||||
| Downside | 2025 | -5.0% | 0 | 0 | 0 | Year criterion | 2026 | |||||
| Downside | 2026 | -2.0% | (unresolved) | 1 | (unresolved) | Missing year example | 2028 | |||||
| Downside | 2027 | 1.0% | (unresolved) | (unresolved) | (unresolved) | |||||||
| Base | 2025 | 5.0% | (unresolved) | (unresolved) | (unresolved) | Example | Formula syntax | Result | Interpretation | |||
| Base | 2026 | 7.0% | (unresolved) | 1 | (unresolved) | Boolean XLOOKUP | =XLOOKUP(1,($A$12:$A$20=$K$11)*($B$12:$B$20=$K$12),$C$12:$C$20,"Not found",0) | 12.0% | Primary result | |||
| Base | 2027 | 8.0% | (unresolved) | (unresolved) | (unresolved) | INDEX/MATCH fallback | =INDEX($C$12:$C$20,MATCH(1,($A$12:$A$20=$K$11)*($B$12:$B$20=$K$12),0)) | 12.0% | Equivalent fallback | |||
| Upside | 2025 | 9.0% | 1 | (unresolved) | (unresolved) | Matching row count | =COUNTIFS($A$12:$A$20,$K$11,$B$12:$B$20,$K$12) | 1 | Unique combination | |||
| Upside | 2026 | 12.0% | 1 | 1 | 1 | Missing combination | =XLOOKUP(1,($A$12:$A$20=$K$11)*($B$12:$B$20=$K$13),$C$12:$C$20,"Not found",0) | Not found | Controlled fallback | |||
| Upside | 2027 | 14.0% | 1 | (unresolved) | (unresolved) | |||||||
| Reliability checks | ||||||||||||
| XLOOKUP result equals the INDEX/MATCH result | OK | |||||||||||
| COUNTIFS confirms exactly one matching scenario-year row | OK | |||||||||||
| COUNTIFS result ties to the visible combined flags | OK | |||||||||||
Overview
Return one assumption from the row where both a selected scenario and year match. The formula converts each comparison to a Boolean array, multiplies the arrays, and looks up the sole row flagged as 1.
When to use it
Use it when two or more fields jointly identify one normalized-table row: scenario and year, product and region, account and entity, or employee and month. It is suitable when the intended combined key is unique.
When not to use it
Use a visible composite key when users need to inspect or reuse the identifier. Use FILTER when every matching row is required. Use a two-way INDEX/MATCH against row and column headers for matrix-shaped data. For older Excel versions, use the included INDEX/MATCH alternative with the required array-entry behavior.
Problem
Scenario alone repeats across years, and year alone repeats across scenarios. Looking up either field can therefore return a plausible but wrong assumption. The calculation must test both conditions on the same row and separately expose duplicates.
Inputs
Input | Location | Sample |
|---|---|---|
Scenario | | Upside |
Year | | 2026 |
Source data
The synthetic table in A12:C20 contains nine assumptions: Downside, Base, and Upside for 2025–2027. Representative rows are:
Scenario | Year | Revenue growth |
|---|---|---|
Downside | 2026 | -2.0% |
Base | 2026 | 7.0% |
Upside | 2026 | 12.0% |
Scenario values are text, years are whole numbers, and returns are percentages. All three arrays must cover the same rows. Each scenario-year pair is intended to occur once; sorting is not required.
Calculations
- Compare every scenario with the selected scenario.
- Compare every year with the selected year.
- Multiply the arrays so only rows satisfying both tests equal 1.
- Search for 1 and return the aligned growth assumption.
- Count the selected combination and reconcile XLOOKUP to INDEX/MATCH.
Outputs
For Upside and 2026, XLOOKUP returns 12.0%. The workbook also returns the same percentage through INDEX/MATCH and a matching-row count of 1. An absent combination returns Not found; a duplicate remains a data-quality exception.
Formula map
=XLOOKUP(1,($A$12:$A$20=$K$11)*($B$12:$B$20=$K$12),$C$12:$C$20,"Not found",0)
Each comparison produces TRUE and FALSE values. Multiplication coerces them to 1 and 0, and only a row satisfying every criterion produces 1. Absolute references preserve the source arrays and selected criteria. The formula returns one scalar value and does not spill.
The supplied reconciliation is:
=INDEX($C$12:$C$20,MATCH(1,($A$12:$A$20=$K$11)*($B$12:$B$20=$K$12),0))
Model checks
The workbook tests that XLOOKUP equals INDEX/MATCH, COUNTIFS finds exactly one selected combination, and the matching count agrees with the visible combined flags. Each supplied control returns OK for the sample selections.
Edge cases
- A missing pair returns
Not foundfrom XLOOKUP. - Duplicate pairs produce several 1s; XLOOKUP returns the first while the uniqueness control returns
CHECK. - A numeric year does not reliably match a year stored as text.
- Blank criteria can match blank source cells within the bounded arrays.
- Errors in any criteria or return array propagate.
- Differently sized arrays produce an error rather than a valid lookup.
Common errors
- Looking up one field: a repeated scenario or year returns the wrong row. Include every field needed for uniqueness.
- Concatenating keys carelessly: values can collide. Use Boolean arrays or a deliberately delimited helper key.
- Ignoring duplicates: the first match looks valid despite ambiguity. Require COUNTIFS to equal 1.
- Mixing data types: visually identical years fail to match. Standardize source and criterion types.
Example
Selecting Upside flags its three rows. Selecting 2026 flags the three 2026 rows. Multiplication leaves only the Upside–2026 row equal to 1, so XLOOKUP returns 12.0%. COUNTIFS independently returns 1, and the visible combined flags also sum to 1.
Example workbook
Edit the cream criteria in Combined Example!K11:K12 or assumptions in A12:C20. Visible row flags, XLOOKUP, INDEX/MATCH, the match count, and three controls update. Formula Review includes an Upside–2028 missing-combination test.
Key takeaway
Create one lookup flag by multiplying aligned Boolean tests, then validate that exactly one row satisfies the complete combination before relying on the returned value.