Yes, you can split multiple matches into separate rows in Excel using formulas like INDEX, SMALL, IF, and ROW, or with the newer FILTER and TEXTSPLIT functions. This guide shows you how to extract every matching record from a lookup table and list each one on its own row, so you stop seeing only the first match.
Why Excel Only Shows One Match
VLOOKUP and INDEX/MATCH are designed to return a single value. When your lookup table has duplicate keys (e.g., the same customer ID appears on multiple orders), those functions stop at the first occurrence. This is fine for unique IDs but fails when you need a full list of related records.
To get every match, you need an array formula that scans the entire lookup column, compares each cell to your search key, and collects the row numbers where the condition is true. Then you feed those row numbers into INDEX to pull the corresponding values from other columns.
The Classic Array Formula Approach
This method works in all Excel versions, including older ones, if you enter it with Ctrl+Shift+Enter (CSE). Suppose your data is in A2:C100, with the lookup value in cell E1 and the column to return in column B.
- In cell F2, enter:
=IFERROR(INDEX($B$2:$B$100, SMALL(IF($A$2:$A$100=$E$1, ROW($A$2:$A$100)-ROW($A$2)+1), ROW()-1)), "") - Press Ctrl+Shift+Enter to make it an array formula (curly braces appear).
- Drag the formula down as far as you need. Each row shows the next matching value; when matches run out, it returns an empty string.
How it works: the IF creates an array of relative row numbers for every cell that equals E1. SMALL then extracts the k-th smallest number from that array, where k is the current row number minus 1. INDEX uses that number to fetch the value from column B.
Using FILTER for Dynamic Arrays (Excel 365/2021)
If you have Excel 365 or Excel 2021, the FILTER function makes this trivial. In any cell, enter:
=FILTER(B2:B100, A2:A100=E1, "No matches")
This spills all matching values down automatically. No dragging, no CSE. You can also filter multiple columns at once: =FILTER(A2:C100, A2:A100=E1) returns entire rows for each match.
If your matches are in a single cell separated by commas (e.g., “apple,banana,cherry”), use TEXTSPLIT to break them into separate cells: =TEXTSPLIT(A1, ",").
How to Choose the Right Method
- Excel 365 or 2021: Use FILTER. It is simpler, faster, and automatically updates when data changes.
- Excel 2019 or older: Use the array formula with SMALL. It works but requires CSE and manual dragging.
- Need to return multiple columns: FILTER can return the whole table; the array formula needs one formula per column.
- Large datasets (100k+ rows): FILTER is more efficient; array formulas can slow down.
Common Problems and Fixes
#N/A errors appear when you drag the array formula beyond the number of matches. Wrap it in IFERROR as shown above.
Blank cells in the result are normal when you drag too far. If you want a clean list, use FILTER which stops automatically.
Case sensitivity: The = comparison is case-insensitive. If you need case-sensitive matching, use EXACT inside the IF condition.
Duplicate matches are returned as duplicates. If you want unique matches only, wrap the formula in UNIQUE.
Real-World Example: Orders by Customer
Imagine a sales table with columns: Order ID, Customer, Amount. You want to list all orders for customer “Acme Corp”.
With FILTER: =FILTER(A2:C100, B2:B100="Acme Corp", "No orders") returns every matching row. With the array formula, you would need three separate formulas (one for each column) or use INDEX with a MATCH that returns the row number.
This pattern is useful for inventory reports, student grades, project tasks, and any parent-child data structure.
Frequently Asked Questions
Can I do this without Ctrl+Shift+Enter? In Excel 365, no need—FILTER is dynamic. In older versions, you must use CSE for array formulas. Alternatively, use AGGREGATE which can handle arrays without CSE: =IFERROR(INDEX(B:B, AGGREGATE(15,6, ROW($A$2:$A$100)/(($A$2:$A$100=$E$1)), ROW()-1)), "").
Why does my formula return 0 instead of blank? If the source cells are truly empty, INDEX returns 0. Use IF(INDEX(...)="", "", INDEX(...)) or wrap in IFERROR with a custom message.
How do I return matches from multiple sheets? Use the same formula but reference each sheet’s range, or use VSTACK (Excel 365) to combine ranges first, then filter.
Can I use this with a dropdown to change the lookup value? Yes, just point the criteria to a cell containing a data validation dropdown. The formula will recalculate automatically.
Is there a way to do this in Google Sheets? Yes, FILTER works identically: =FILTER(B2:B100, A2:A100=E1). The array formula also works with CSE.
Limits and Performance Tips
Array formulas recalculate every time any cell in the workbook changes, which can be slow on large datasets. To speed up, limit the range to the actual data size (e.g., A2:A1000 instead of A:A). For very large data, consider using Power Query (Get & Transform) to split matches into rows—it is designed for that and handles millions of rows efficiently.
Also note that the array formula returns row numbers relative to the start of the range. If your data starts at row 2, the first match has relative row 1. The ROW() function inside the formula handles this automatically.
Related
Formula used
in n | Number of matches to return | - | 5 | 1 | 100 in r | Starting row for data | - | 2 | 1 | 1000000 out idx | Row number of match | - | r + 0 * sqrt(n) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Kick an Uma Codes? Meaning & Use
- Google Forms as Expense Tracker: Step-by-Step
- GBP to INR Business Payments: Bank vs Fintech vs FX Broker1,049,725.00 INR
- Evaluate Claude for Enterprise Workloads: Checklist
- Smart Lock Modules Worth Buying Early
- Wi-Fi Name Exposes More Info Than You Think?