How to Use XLOOKUP with Multiple Criteria in Excel

Introduction
Excel’s XLOOKUP function has revolutionized how we search for data in spreadsheets. One powerful yet lesser-known application is using XLOOKUP with multiple criteria to perform complex lookups efficiently. This guide dives into how to leverage XLOOKUP multiple criteria techniques for advanced data retrieval in Excel.
Understanding XLOOKUP Basics
XLOOKUP is a modern replacement for older lookup functions like VLOOKUP and HLOOKUP. It allows you to search a range or array, find the matching value, and return a corresponding value from another range or array. The basic syntax is:
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
However, when you need to match multiple conditions, simply providing one lookup_value won’t suffice. This is where combining multiple criteria comes into play.
Why Use Multiple Criteria in XLOOKUP?
Many real-world scenarios require looking up data based on more than one condition. For example, finding a sales value based on both Product and Region, or identifying an employee’s record based on Name and Department. Using XLOOKUP with multiple criteria enables these complex searches without using helper columns or complex formulas like INDEX/MATCH with concatenation.
Method 1: Concatenate Criteria Inside XLOOKUP
The simplest method is to concatenate multiple criteria into a single lookup value and match it against a concatenated lookup array.
Example
Suppose you have the following data:
| Product | Region | Sales |
|---|---|---|
| Widget | North | 100 |
| Widget | South | 150 |
| Gadget | North | 200 |
| Gadget | South | 180 |
You want to find the sales for Widget in the South region.
The formula would be:
=XLOOKUP("WidgetSouth", ProductRange & RegionRange, SalesRange, "Not Found")
Where:
ProductRangeis the range containing product names (e.g., A2:A5)RegionRangeis the range containing regions (e.g., B2:B5)SalesRangeis the range containing sales data (e.g., C2:C5)
This formula combines the product and region in the lookup array and also concatenates the lookup value to match it.
Method 2: Using an Array Formula with Multiplication
Another approach is to use logical multiplication (*) inside the match criteria to evaluate multiple criteria without concatenation.
Example
Using the same dataset, you can write:
=XLOOKUP(1, (ProductRange="Widget")*(RegionRange="South"), SalesRange, "Not Found")
Explanation:
(ProductRange="Widget")returns an array of TRUE/FALSE values for the product condition.(RegionRange="South")returns an array of TRUE/FALSE values for the region condition.- Multiplying these arrays coerces TRUE to 1 and FALSE to 0, so only rows where both conditions are TRUE result in 1.
- We then lookup the number 1 in this array and return the corresponding sales value.
Method 3: Using FILTER with XLOOKUP for Dynamic Criteria
Sometimes, combining XLOOKUP with the FILTER function can help extract multiple matching rows or apply complex filters before lookup.
Example
To find all sales of a product in a region, use FILTER first:
=FILTER(SalesRange, (ProductRange="Widget")*(RegionRange="South"))
This returns all sales matching the criteria. You can combine this with XLOOKUP if needed, but FILTER alone often suffices for multiple criteria extraction.
Practical Tips for Using XLOOKUP with Multiple Criteria
- Ensure Range Consistency: All ranges used for lookup_array and return_array should be of the same size.
- Use Absolute References: When copying formulas, use $ to lock ranges.
- Handle Errors Gracefully: Use the [if_not_found] argument of XLOOKUP to display custom messages instead of errors.
- Case Sensitivity: XLOOKUP is not case-sensitive by default. Use additional functions if case sensitivity is required.
Conclusion
Mastering XLOOKUP multiple criteria lookups empowers you to perform complex data retrieval operations in Excel efficiently. Whether through concatenation, logical multiplication, or combining with FILTER, these advanced techniques make your spreadsheets smarter and more dynamic. Practice these methods to enhance your Excel expertise and streamline your data workflows.
Frequently Asked Questions (FAQs)
Can I use XLOOKUP with more than two criteria?
Yes, you can combine multiple criteria by extending the concatenation or logical multiplication techniques. For example, multiply multiple logical tests or concatenate all criteria into a single lookup value.
Is XLOOKUP case-sensitive when matching criteria?
No, XLOOKUP is not case-sensitive by default. To perform case-sensitive lookups, you need to use additional functions like EXACT combined with array formulas.
What is the difference between using concatenation and multiplication for multiple criteria?
Concatenation combines criteria into a single string, which is straightforward but requires combining ranges. Multiplication uses logical TRUE/FALSE arrays and is more dynamic but may require array formula handling.
Can I use XLOOKUP multiple criteria on tables with dynamic ranges?
Yes, using Excel tables or named dynamic ranges ensures that your formulas automatically adjust as you add or remove data.
What if XLOOKUP returns an error when using multiple criteria?
This usually means no matching record was found. Use the optional [if_not_found] argument to display a friendly message or double-check your criteria and ranges.