Yes, XLOOKUP can return multiple values, but not as a single spilled array in one cell. The standard XLOOKUP function returns one matching value per lookup; to get multiple related values (for example, a whole row or column of data for a matched ID), you either use XLOOKUP with a return array (like a whole column) or combine it with FILTER, which is the more flexible tool for pulling several matches. This article explains both approaches, when to use each, and how to handle common problems.
What XLOOKUP Actually Returns
XLOOKUP searches a lookup array for a key and returns the value from the same position in a return array. The return array can be a single column, a single row, or even a multi-column range. If you give it a multi-column return array, it will return the entire row of data for the matching key—but that result spills into adjacent cells automatically (if you have Microsoft 365 or Excel 2021). For example, with lookup values in A2:A10 and data in B2:D10, the formula =XLOOKUP(A2, A2:A10, B2:D10) returns the three cells B2, C2, and D2 when entered in a cell, spilling to the right. That is multiple values in the sense of multiple columns, but it is still only one match.
If you need multiple different matches (e.g., all orders for a customer ID), XLOOKUP cannot do that by itself—it stops at the first match. The FILTER function is the correct tool for that scenario.
How to Return a Whole Row or Column with XLOOKUP
The simplest way to get multiple values from one lookup is to set the return array to include more than one column. Here is a concrete example:
- Layout: A2:A20 contains product IDs, B2:B20 contains product names, C2:C20 contains prices, D2:D20 contains stock.
- Goal: Find product ID “P-100” and return name, price, and stock.
- Formula (in F2):
=XLOOKUP("P-100", A2:A20, B2:D20)
This returns three cells: F2 = product name, G2 = price, H2 = stock. The formula spills to the right. If you only want the price and stock, use =XLOOKUP("P-100", A2:A20, C2:D20).
Note: This works in Excel 365 and Excel 2021. In older versions, you would need to press Ctrl+Shift+Enter or use INDEX/MATCH.
Returning Multiple Matches with FILTER
When you need all matching rows (not just the first), use FILTER instead of XLOOKUP. FILTER returns an array of all rows that meet a condition. For example, with sales data in A2:C100 (customer in A, date in B, amount in C), to get all rows for customer “Acme”:
Formula (in E2): =FILTER(A2:C100, A2:A100="Acme", "No matches")
This spills down and to the right, showing every Acme row. The third argument is the value to display if no match is found—use "" for a blank cell.
FILTER works with multiple conditions too, using * for AND and + for OR. For instance, to get Acme orders over $500: =FILTER(A2:C100, (A2:A100="Acme")*(C2:C100>500), "None").
XLOOKUP vs FILTER: Which Should You Use?
Choose based on what you need:
- Use XLOOKUP when you want exactly one match (like a VLOOKUP replacement) and you need to return a known set of columns for that match.
- Use FILTER when you want all matching rows, or when the number of matches is unknown.
- Use XLOOKUP when you need to search from the bottom (with match_mode -1) or use wildcards—FILTER does not have built-in wildcard support, but you can use SEARCH or ISNUMBER.
- Use FILTER when you want to sort the results with SORT, or combine with UNIQUE to get distinct values.
For example, to get a list of unique customers who bought a specific product, you would use =UNIQUE(FILTER(A2:A100, B2:B100="Widget"))—XLOOKUP cannot do that.
Common Problems and How to Solve Them
Here are typical issues when trying to return multiple values:
- #SPILL! error: The formula would spill into cells that already have data. Clear the obstructing cells or move the formula to an empty area.
- Only first match appears: That is XLOOKUP’s design. Switch to FILTER.
- Results are in one cell separated by commas (or appear as #VALUE!): That happens if you try to concatenate an array without using TEXTJOIN. For example,
=TEXTJOIN(", ", TRUE, FILTER(C2:C100, A2:A100="Acme"))will list all amounts in one cell. - FILTER returns 0 for blank cells: Use
=FILTER(A2:C100, A2:A100="Acme", "")but if the source has blanks, they will show as 0. Wrap with IF to convert:=IF(FILTER(...)="", "", FILTER(...))—though this can be complex; better to keep source clean. - Excel 2019 or older: FILTER and XLOOKUP do not exist. Use INDEX/SMALL/IF array formulas (entered with Ctrl+Shift+Enter) or use Power Query to filter and load.
Returning Multiple Values in Google Sheets
Google Sheets has the same functions: XLOOKUP (since 2022) and FILTER. The syntax is identical. For example, =FILTER(A2:C100, A2:A100="Acme") works the same. In Google Sheets, you do not need to press Ctrl+Shift+Enter; it spills automatically. One difference: Google Sheets has a QUERY function that can also return multiple matches with SQL-like syntax, e.g., =QUERY(A2:C100, "select * where A = 'Acme'"). That is often more concise for complex conditions, but FILTER is more straightforward for simple cases.
Using XLOOKUP with a Helper Column to Get Multiple Matches
If you must use XLOOKUP (for compatibility or habit) and need multiple matches, you can create a helper column that numbers each occurrence of a key. For example, with customer names in A2:A100, add a helper column B with the formula =COUNTIF($A$2:A2, A2) which gives 1 for the first occurrence, 2 for the second, etc. Then you can use XLOOKUP to find the nth occurrence: =XLOOKUP(1, (A2:A100="Acme")*(B2:B100=1), C2:C100) for the first amount, and change the 1 to 2 for the second. This is more work than FILTER but works in older Excel versions if you use array formulas.
Frequently Asked Questions
Can XLOOKUP return multiple rows?
No, XLOOKUP returns one row (or one value) per lookup key. It stops at the first match. To return multiple rows, use FILTER, which returns all rows that match a condition.
How do I return multiple columns with XLOOKUP?
Set the return array to include multiple columns, like =XLOOKUP(A2, A2:A10, B2:D10). The result spills to the right, giving you all columns for that matched row.
Why does my XLOOKUP return #VALUE! when I try to get multiple values?
That usually happens when you try to use XLOOKUP to return an array into a single cell without spilling, or when the return array is not the same size as the lookup array. Make sure the return array has the same number of rows as the lookup array, and that you have Excel 365 or 2021 for dynamic arrays.
What is the difference between XLOOKUP and FILTER for multiple values?
XLOOKUP returns one match (first found) and can return multiple columns for that match. FILTER returns all matching rows (multiple matches) and can return multiple columns too. Use FILTER when you need more than one match.
Can I use XLOOKUP to return all matches in one cell?
Yes, by combining with TEXTJOIN: =TEXTJOIN(", ", TRUE, FILTER(C2:C100, A2:A100="Acme")). But that is using FILTER inside TEXTJOIN, not XLOOKUP. XLOOKUP alone cannot list multiple matches.
Does XLOOKUP work in Excel 2019?
No, XLOOKUP is only available in Excel 2021 and Microsoft 365. In Excel 2019, use INDEX/MATCH or VLOOKUP, and for multiple matches use an array formula with INDEX/SMALL/IF.
Related
- B is for Butterfly Worksheet: Free Printables & Uses
- How to Calculate Battery Size for a Solar System
- Introduction to R Coding: Basics & First Steps
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- SUMPRODUCT in Excel: Examples, Criteria, and TipsA simple example of SUMPRODUCT in Excel is =SUMPRODUCT(B2:B5,C2:C5): if B2:B5 contains quantities and C2:C5 contains unit prices,…
- SUBTOTAL Function Number: Excel’s 1-11 & 101-111 CodesThe SUBTOTAL function number is the first argument you pass to SUBTOTAL, and it tells Excel which operation…
- Combine Names in Excel: Join Two Cells with a FormulaWith a first name in A2 and a last name in B2, enter =A2&" "&B2 in another cell…
- IFERROR to Return Zero in Excel: Formula and UsesTo make an Excel formula return zero when it produces an error, wrap it in IFERROR. For example,…
- Date Filter Formula in Excel: Examples and TipsIn Excel for Microsoft 365, use the FILTER function to return rows whose dates meet your criteria. For…
- Weekday Excel Shortcut: Formulas and Fast Ways to Get ItExcel has no dedicated keyboard shortcut that turns a selected date into its weekday. For a date in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.