Excel XLOOKUP Return All Matches: A Practical Guide
Learn how to return every matching row for a lookup value in Excel using XLOOKUP, FILTER, and legacy array formulas. Step-by-step methods, real-world examples, and best practices from XLS Library.

With this guide, you’ll learn how to excel xlookup return all matches for a given lookup value in Excel. You’ll see dynamic-array approaches using FILTER to spill results, plus legacy INDEX/SMALL formulas for older Excel. This quick-start overview covers when to use each method and how to keep results tidy across sheets. According to XLS Library, these patterns speed data lookups.
Why returning all matches matters in data analysis
In many real-world datasets, a single lookup value appears multiple times. Instead of stopping at the first match, analysts often need all corresponding rows to perform aggregations, reconciliations, or quality checks. The keyword excel xlookup return all matches encapsulates this common requirement and sets the stage for robust formulas. The XLS Library team notes that a proper method saves hours of manual work and reduces errors in large workbooks.
Core concepts: XLOOKUP, FILTER, and legacy alternatives
Excel’s XLOOKUP is a powerful replacement for VLOOKUP and INDEX/MATCH. However, by itself it returns a single match. To retrieve all duplicates, you pair it with other functions or switch to dynamic array-enabled tools like FILTER. In contrast, legacy solutions use array formulas with INDEX, SMALL, IF, and ROW to grab successive matches — but these require careful entry (Ctrl+Shift+Enter in older Excel) and can be less readable. The key is to pick a method that matches your Excel version and data structure, then explain it clearly to colleagues. The XLS Library analysis highlights that the right approach depends on whether you want one column, multiple columns, or entire rows.
When to use FILTER for dynamic arrays
If you’re on Excel 365 or 2021 with dynamic arrays, FILTER is the simplest, most reliable way to return all matches. FILTER spills results automatically, returning every row that satisfies the condition. This works beautifully for single-column lookups or when you need the full row. The formula is straightforward: =FILTER(return_range, lookup_range=lookup_value, "No matches"). Add an optional if_empty argument to present a friendly message when there are no matches. In practice, FILTER makes dashboards and reports more interactive and easier to maintain. According to XLS Library analysis, organizations adopting dynamic arrays report faster model refreshes and clearer error handling across reports.
Step-by-step: returning all matches with FILTER
In practice, this is how you implement it in a typical sales dataset:
- Step 1: Prepare your data by ensuring a stable layout with a lookup column (A) and return columns (B:C).
- Step 2: Decide the lookup value location (e.g., G2).
- Step 3: Enter the formula: =FILTER(B:C, A:A=G2, "No matches").
- Step 4: Confirm the spill and ensure the destination range is clear to accommodate results.
- Step 5: Copy the formula to adjacent cells if you need results for multiple lookup values.
- Step 6: Verify that each spilled result aligns with the correct lookup value and data range.
- Step 7: Optional: wrap with IFERROR to customize messages when there are no matches.
Step-by-step: older Excel approach with INDEX/SMALL
For users on older Excel versions without dynamic arrays, you can approximate by building an array formula:
- Step 1: Set up your data in a similar two-column structure (lookup in A, return in B).
- Step 2: Define the lookup value (e.g., G2) and the number of matches to retrieve (e.g., k).
- Step 3: Enter an array formula to fetch the k-th match: =INDEX(B:B, SMALL(IF(A:A=G2, ROW(A:A)-MIN(ROW(A:A))+1), k))
- Step 4: Confirm with Ctrl+Shift+Enter (CSE) to create a multi-cell spill in legacy Excel setups.
- Step 5: Drag down to retrieve subsequent matches.
- Step 6: Add IFERROR wrappers to handle cases with fewer matches than the number of output cells.
Practical examples: real-world scenarios
- Example 1: Customer orders – return all order details for a given customer ID. Using dynamic arrays: =FILTER(Orders!B:D, Orders!A:A=CustomerID). This returns multiple columns for all matching rows.
- Example 2: Inventory lookup – find every item whose SKU equals a target value and display restock levels. With FILTER: =FILTER(Inventory!B:C, Inventory!A:A=TargetSKU).
- Example 3: Student records – pull all records for students who share the same ID in a classroom roster. FILTER yields a complete row for each match, making it ideal for dashboards.
Troubleshooting: duplicates, blanks, and misalignment
- Duplicates: If you want to preserve duplicates, FILTER naturally keeps all matches; if you want to collapse duplicates use UNIQUE on the result.
- Blanks: If the dataset contains blanks in the return column, consider wrapping the formula in IFERROR or cleaning the data first.
- Mismatched data types: Ensure lookup values and columns are the same type (text vs number) to avoid false negatives.
- Alignment: When returning multiple columns, keep the return_range aligned with the lookup range to prevent misaligned results.
Performance and best practices
Dynamic arrays simplify maintenance but may impact calculation time on very large datasets. To optimize:
- Limit the return range to only necessary columns and rows.
- Sort and filter data at the source when possible to reduce spill results.
- Use named ranges for readability and to reduce formula errors across sheets.
- Document the approach so teammates understand the logic behind the lookups.
- If you anticipate frequent structural changes to the dataset, build a small metadata sheet to manage references and ranges.
Quick-reference cheat sheet
- Use =FILTER(return_range, lookup_range=lookup_value, "No matches") for all-matches results in Excel 365/2021.
- For older Excel versions, try INDEX/SMALL with IF and ROW, and remember to confirm with CSE.
- When returning entire rows, include multiple columns in the return_range (e.g., B:C).
- Wrap formulas with IFERROR to present clean messages when no matches exist.
- Use data-cleaning steps (TRIM, VALUE) to ensure consistent lookups across datasets.
Tools & Materials
- Excel 365 or Excel 2021 with dynamic arrays(Dynamic arrays are required for FILTER-based solutions.)
- Sample dataset prepared in Excel (lookup column and return columns)(Two-column minimum; consistent data types matter.)
- Named ranges (optional)(Improves readability and maintainability.)
- Test workbook on another sheet(Useful for validating cross-workbook references.)
- Notes/documentation sheet(Helps teammates understand the approach.)
Steps
Estimated time: 15-30 minutes
- 1
Prepare your data
Ensure your dataset has a clear lookup column and return columns. Clean values with TRIM and VALUE where needed to avoid mismatches. Create a named cell for the lookup value to simplify formulas.
Tip: Test with a small sample first to confirm the structure. - 2
Choose the dynamic-array approach
If you have Excel 365/2021, dynamic arrays let you spill results with a single FILTER formula. Decide whether you need one column or entire rows.
Tip: Verify that your version supports dynamic arrays. - 3
Write the FILTER formula for exact matches
Enter a simple, readable formula to return all matches: =FILTER(return_range, lookup_range=lookup_value, "No matches").
Tip: Use an if_empty message to handle zero matches gracefully. - 4
Return multiple columns or rows
Expand the return_range to include all columns you want (e.g., B:C for multiple fields or A:B for a row-block).
Tip: Keep ranges anchored to prevent shifting when data changes. - 5
Handle no matches safely
Wrap with IFERROR to present a friendly message instead of an error. This improves user experience in dashboards.
Tip: A short, clear message helps users understand the result. - 6
Test with multiple lookup values
Copy or adapt the formula to other cells to verify it spills correctly for different inputs.
Tip: Check for spill overlap; clear adjacent cells. - 7
Older Excel workaround (INDEX/SMALL)
If dynamic arrays aren’t available, implement an array formula to fetch successive matches using INDEX and SMALL.
Tip: Remember to confirm with Ctrl+Shift+Enter in legacy Excel. - 8
Extend to multiple lookup values on a sheet
Drag or fill to apply to a list of lookup values; ensure consistent references.
Tip: Consider using LET to simplify complex formulas. - 9
Document your solution
Add a short note describing the method and why it’s chosen for future maintainers.
Tip: Good documentation saves time in audits and handoffs. - 10
Validate and report
Create a simple validation checklist to ensure results align with source data and business rules.
Tip: Include edge cases like missing data or mismatched types.
People Also Ask
Can XLOOKUP return all matches by itself?
No. XLOOKUP returns a single match by default. To get all matches, use FILTER on modern Excel or INDEX/SMALL on older versions.
XLOOKUP returns one result by default; use FILTER or an INDEX/SMALL workaround to get multiple matches.
What Excel versions support returning all matches easily?
Excel 365 and Excel 2021 support dynamic arrays, which let FILTER spill all matching rows. Older versions require more complex array formulas using INDEX and SMALL.
Dynamic arrays are in Excel 365 and 2021, which makes getting all matches simpler; older versions need workarounds.
How do I handle no matches in my result?
Wrap your formula with IFERROR (or IFNA) to display a friendly message when no records match the lookup value.
Use IFERROR to show a clear message when there are no matches.
Can I return multiple columns or just a single column?
Yes. Include all desired return columns in the FILTER’s return_range to spill corresponding columns for each match.
You can spill multiple columns by including more columns in the return range.
What about duplicates?
FILTER will return all duplicates by default. If you want to collapse duplicates, apply UNIQUE to the spilled results.
If you need to remove duplicates, wrap the result with UNIQUE.
Is there a performance concern with large datasets?
Dynamic arrays are efficient for typical datasets, but very large ranges can slow calculations. Limit ranges and consider data model optimizations.
For big datasets, optimize ranges and consider data model improvements.
Watch Video
The Essentials
- Use dynamic arrays (FILTER) to return all matches in modern Excel.
- Older Excel requires INDEX/SMALL array formulas as a workaround.
- Wrap results with IFERROR to handle zero-match cases gracefully.
- Returning entire rows is straightforward with FILTER by expanding the return range.
- Document the approach for team maintenance.
