How to Index And Match All Matches in Excel

Learn multiple Excel methods to return every value that matches your criteria instead of only the first hit. Step-by-step tutorials, business-grade examples, and expert troubleshooting tips.

excelformulaspreadsheettutorial
11 min read • Last updated: 7/2/2025

How to Index And Match All Matches in Excel

Why This Task Matters in Excel

Filtering data to display every record that meets specific conditions is one of the most common, high-value activities in spreadsheet work. Customer support teams look up every ticket number attached to an account, finance professionals list all payments made by a supplier, and operations analysts pull every shipment that left a warehouse during a particular week. Returning all matches instead of only the first match is crucial for:

  • Complete reporting – partial lookups can lead to under-reporting and misinformed decisions.
  • Reconciliation – accounting must match every invoice line, not just the first one.
  • Audit trails – regulators or managers often request the full list of transactions behind a summary number.
  • Dynamic dashboards – slicers and controllers need formulas that automatically spill every qualifying row to downstream charts.

Excel’s standard lookup functions such as VLOOKUP, XLOOKUP, and a basic INDEX-MATCH combo are designed to stop at the first match. If you only know those basics, you have no native way to get rows two, three, and beyond without additional logic. That limitation often forces users into manual filtering, copy-pasting, or even exporting to other tools, all of which break automation chains and introduce errors.

Mastering the techniques that return every match automatically keeps your workflow inside Excel, preserves one-click refresh capability, and integrates cleanly with pivot tables, charts, Power BI, and VBA macros. When the underlying data changes, your output updates instantly – no extra steps required. Failure to know these methods can create duplicated effort, inconsistent reporting, and audit gaps that are expensive to fix later.

Learning to index and match all matches also deepens your understanding of array logic, dynamic ranges, and spill behavior, skills that transfer directly to advanced topics such as dynamic named ranges, lambda functions, and custom data connectors.

Best Excel Approach

The modern, easiest-to-audit way to return every matching record is to combine the FILTER function with well-structured criteria. FILTER was introduced with Microsoft 365’s dynamic array engine and is purpose-built to spill all qualifying rows or columns into adjacent cells.

=FILTER(ReturnRange, CriteriaRange=LookupValue, "No matches")

Why this is usually best:

  1. Simplicity – a single function instead of the nested array gymnastics needed in legacy formulas.
  2. Readability – anyone can see the filter condition without decoding SMALL or ROW.
  3. Dynamic spill – no need to pre-count how many matches there might be.
  4. Performance – optimized in the newer calc engine, especially for large tables.

When to choose alternatives:

  • Users on Excel 2019 or earlier with no access to dynamic arrays must use legacy array formulas (INDEX + SMALL + IF or INDEX + AGGREGATE).
  • Workbooks that will be opened in both modern and older versions can include a hidden compatibility sheet with the legacy formula.
  • Extremely large datasets may benefit from Power Query or Power Pivot, which push filtering to the data model.

Below is the legacy CSE (control-shift-enter) pattern many analysts still rely on:

=IFERROR(
 INDEX(ReturnRange,
        SMALL(
              IF(CriteriaRange=LookupValue, ROW(ReturnRange)-MIN(ROW(ReturnRange))+1),
        ROWS($A$1:A1)
             )
      ),
 "")

The outer ROWS($A$1:A1) increments as the formula is filled downward, pulling the 1st, 2nd, 3rd smallest row number that meets the condition.

Parameters and Inputs

ReturnRange – The cells that contain the values you want back. They can be a single column like [C2:C1000] or multiple columns like [B2:F1000] if you want entire rows.

CriteriaRange – The range evaluated against your lookup value (often a key column such as CustomerID). It must be exactly the same height as ReturnRange when you use FILTER, or the same height when using INDEX + SMALL + IF.

LookupValue – The specific item you are searching for, such as \"ACME-01\" or the contents of cell [H2]. It may also be a calculated value (e.g., TODAY()).

Optional parameters:

  • FILTER’s third argument: what to display when nothing matches. Leaving it out returns the #CALC! error.
  • Multiple criteria: combine boolean logic, for example (Criteria1Range=Value1)*(Criteria2Range=Value2) for legacy formulas, or embed multiple conditions in FILTER with logical operators.

Data preparation:

  • Remove leading/trailing spaces and use consistent data types (text vs numbers).
  • Turn your data into an official Excel table (Ctrl+T) so range references adjust automatically as records grow or shrink.
  • Ensure no blank rows within the dataset, because legacy array formulas rely on contiguous ranges.

Edge cases:

  • Zero matches – decide whether you want a friendly message, blank output, or an error to drive downstream alerts.
  • Duplicate blanks – FILTER treats blanks as legitimate records; add an extra criterion if you want to exclude them.
  • Case sensitivity – FILTER is not case-sensitive, but legacy SEARCH or EXACT combinations can enforce it if required.

Step-by-Step Examples

Example 1: Basic Scenario – List every order for one customer

Imagine a sales ledger in [A1:D16] with columns: OrderID, Customer, Date, Amount. You receive a manager request: “Show me all orders placed by customer CUST-104.”

  1. Convert the range to a table and name it TblSales for clarity.
  2. In cell [F2], type the customer code you want to inspect: CUST-104.
  3. In cell [F4], enter the FILTER formula:
=FILTER(TblSales, TblSales[Customer]=F2, "No orders")
  1. Press Enter. Modern Excel instantly spills every row that matches CUST-104 into columns F-I (four columns wide because TblSales has four columns).

Expected result: two complete rows where Customer equals CUST-104. If the data updates and a new qualifying row appears, the spill range automatically expands.

Why it works: FILTER builds a boolean array [(FALSE, TRUE, FALSE…)] by comparing each customer value to F2. It keeps rows that evaluate as TRUE and discards the rest. The spill range starts at the formula cell and grows downward as needed.

Variations:

  • Filter only the amount column by replacing TblSales with TblSales[Amount] in the first argument.
  • Wrap SORT around FILTER to order the returned rows:
=SORT(
  FILTER(TblSales, TblSales[Customer]=F2),
  3, 1)   // sort by Date ascending

Troubleshooting: If nothing spills, check for trailing spaces in Customer codes or confirm that [F2] is spelled exactly like the source. Use TRIM or CLEAN if needed.

Example 2: Real-World Application – Multi-criteria inventory pull

You manage a parts warehouse. Table TblInventory includes PartID, Location, Status, Quantity. A requisition form asks for “all available parts at location WH-EAST with Status = ‘Available’.”

Step-by-step:

  1. Make sure TblInventory is a proper table with structured references.
  2. Put the desired location in [J2] and the desired status in [K2].
  3. In [J4], enter:
=FILTER(
  TblInventory,
  (TblInventory[Location]=J2) * (TblInventory[Status]=K2),
  "None in stock")

Explanation of logic: The multiplication operator acts as an AND because TRUE*TRUE = 1 (treated as TRUE) and any FALSE turns the result into 0. FILTER keeps rows where the combined condition equals TRUE.

Business improvement: This formula drives a dependent dropdown list in a requisition sheet. The user picks a location and only valid in-stock parts appear, preventing accidental back-orders.

Integration:

  • Use the spilled range as the source for Data Validation lists.
  • Wrap UNIQUE around FILTER if you only want distinct PartIDs.

Performance notes: For 50,000 rows, FILTER remains fast, but it helps to keep the table in an adjacent worksheet to reduce screen repaint time. Converting the workbook to Excel Binary Workbook (.xlsb) may further speed up saves.

Example 3: Advanced Technique – Legacy array formula with automatic row numbers

Your organization is still on Excel 2016, and you must share workbooks externally. You need every payment line for a vendor code stored in [A2]. Data lives in [A5:E10000] with Vendor in column B.

Legacy solution:

  1. In [G5] (first output row) enter:
=IFERROR(
 INDEX($A$5:$E$10000,
        SMALL(
              IF($B$5:$B$10000=$A$2, ROW($B$5:$B$10000)-ROW($B$5)+1),
              ROWS($G$5:G5)
             ),
        COLUMN(A:A)
       ),
 "")
  1. Confirm this with Control-Shift-Enter to commit as an array formula (curly braces will appear).
  2. Copy it right for five columns, then drag downward for, say, 500 rows.

How it works:

  • IF($B$5:$B$10000=$A$2, …) returns an array of row offsets where the vendor matches.
  • SMALL picks the nth smallest offset; ROWS($G$5:G5) provides n.
  • INDEX retrieves the entire row, while COLUMN(A:A) picks the appropriate column as you copy across.
  • IFERROR makes blank cells once the SMALL index runs out of rows.

Edge handling: If the data exceeds 10,000 rows, extend the ranges. To future-proof, store the maximum possible rows in a named range.

Professional tips: Encapsulate the array part in a named formula such as VendorRows, then your main formula simplifies to =IFERROR(INDEX(TblPayments,VendorRows,COLUMNS($A:A)),""). That improves readability and maintenance.

Tips and Best Practices

  1. Convert datasets to Excel tables so column names appear in formulas, enhancing readability and automatically expanding ranges.
  2. When using FILTER, pre-sort the table with your desired order so the spill range inherits it, or wrap SORT around the result for precise control.
  3. Combine FILTER with LET for complex criteria to avoid repeating long table references and boost performance.
  4. Add an input checkbox that toggles case sensitivity by wrapping EXACT around your comparison logic.
  5. Keep legacy array formulas on a hidden sheet if you still need backward compatibility, and clearly label them “Requires CSE.”
  6. Test performance on a copy with 100,000 dummy rows to ensure the workbook remains responsive before releasing to production.

Common Mistakes to Avoid

  1. Mismatched range sizes – FILTER throws #VALUE! if ReturnRange and CriteriaRange heights differ. Always confirm identical row counts.
  2. Forgetting to press Control-Shift-Enter in pre-365 Excel – the formula returns only one value instead of spilling multiple. Double-check the curly braces after entry.
  3. Using relative references in ROWS() for legacy formulas – copying downward can misalign the nth counter. Anchor the first cell with $ signs.
  4. Overlooking hidden spaces – “ACME ” will not match “ACME”. Use CLEAN and TRIM or the newer TEXTSPLIT/TRIM combos.
  5. Exposing errors to downstream formulas – wrap FILTER with IFERROR or supply its third parameter to provide graceful blanks.

Alternative Methods

MethodVersions SupportedEase of UsePerformance on 100k rowsLearning CurveMain Drawbacks
FILTER365 & Excel 2021Very highExcellentLowNot available in older versions
INDEX + SMALL + IF2007-365ModerateGood (but slower)MediumRequires CSE, complex to read
INDEX + AGGREGATE2010-365ModerateGoodMediumSlightly more opaque syntax
Power Query2010-365High (UI driven)Excellent (query folding)LowOutput is static unless refreshed
Pivot Table Page Filters2007-365HighExcellentLowOutput format limited, less flexible

Choose FILTER for new workbooks where possible. Pick Power Query for extremely large datasets or where you want to combine, cleanse, and store the filtered table separately. Use legacy formulas only when backward compatibility demands it.

FAQ

When should I use this approach?

Use it whenever you need every record that meets a condition to feed dashboards, reports, or exports. It is perfect for transaction lists, log extracts, and drill-through sheets.

Can this work across multiple sheets?

Yes. Reference the source sheet explicitly:

=FILTER('RawData'!A:E, 'RawData'!B:B=H2, "")

Legacy formulas also work, but remember to lock sheet names with single quotes if they contain spaces.

What are the limitations?

  • FILTER is unavailable in Excel 2019 or earlier.
  • Dynamic spills cannot overlap other data; keep output areas clear.
  • Array formulas may slow down if you reference entire columns in older versions. Use bounded ranges instead.

How do I handle errors?

Supply FILTER’s third argument for no-match scenarios, wrap complex formulas in IFERROR, and consider using ISNUMBER/SEARCH checks for text find operations that could return #VALUE!.

Does this work in older Excel versions?

Yes, but you must use the array-formula techniques demonstrated earlier. Power Query is another backward-compatible option starting with Excel 2010 (install the free add-in for 2010-2013).

What about performance with large datasets?

FILTER in 365 is multi-threaded and handles hundreds of thousands of rows efficiently. For legacy array formulas, minimize volatile functions and avoid entire-column references. For millions of rows, offload to Power Query or Power Pivot.

Conclusion

Knowing how to “index and match all matches” elevates your Excel skillset from basic lookups to professional-grade data extraction. You can create dynamic reports, automate reconciliations, and satisfy audit requirements without manual intervention. Whether you leverage the modern FILTER function or master the legacy array patterns for compatibility, the underlying concepts sharpen your grasp of arrays and spill logic. Continue experimenting with multiple criteria, dynamic named ranges, and Power Query to push these techniques further and integrate them into your broader analytics workflow.

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.