How to Get All Matches Cell Contains in Excel
Learn multiple Excel methods to get all matches cell contains with step-by-step examples and practical applications.
How to Get All Matches Cell Contains in Excel
Why This Task Matters in Excel
Imagine you manage a product master sheet holding thousands of items, but you want a quick list of every product description that contains the word “green” for an upcoming eco-friendly campaign. Or you track customer feedback and need to isolate all comments that mention “refund” to investigate service issues. In day-to-day analysis, the ability to pull every row whose cell contains specific text—without missing any instances—is critical to accuracy, efficiency, and insight.
Across industries, analysts, marketers, accountants, and operations managers rely on Excel to sift through raw data. Retail buyers filter SKU lists for “XL” or “Kids,” HR teams find all employees with “Manager” in their title, and logistics coordinators extract tracking numbers that contain a port code. Whether you are cleaning data, building dashboards, or preparing regulatory reports, getting all matches based on text fragments is foundational.
Excel is uniquely positioned for this task because it blends fast, in-cell formulas, powerful dynamic arrays, and supplementary tools like Power Query—all inside one familiar interface. Learning a robust technique to return every matching result keeps you from slow manual filtering, repetitive copy-pasting, or error-prone visual scans. Failure to master the skill can yield incomplete reports, overlooked compliance issues, or missed business opportunities.
Finally, knowing how to grab every match meshes perfectly with other Excel capabilities: you can feed the results to charts, PivotTables, or further formulas. The same logic you use here also powers sophisticated tasks such as dynamic dependent drop-downs, interactive search boxes, and automated QA checks. In short, this skill is a productivity multiplier that interlocks with broader Excel workflows.
Best Excel Approach
The most reliable modern method is to combine the FILTER function with SEARCH (or FIND) so Excel returns a dynamic array listing every row in a source range whose target cell contains the keyword. The formula is short, readable, and fully spills results—no helper columns required. It automatically expands or contracts as source data grows.
Logic overview:
- SEARCH(keyword, lookup_range) returns the position of the keyword inside each cell; if not found, it returns a #VALUE! error.
- ISNUMBER(...) converts those positions into TRUE/FALSE—TRUE where the keyword exists, FALSE otherwise.
- FILTER(source_range, include_array) keeps only the TRUE rows, offering a complete list of matches.
Syntax template:
=FILTER(source_range, ISNUMBER(SEARCH(keyword_cell, lookup_range)), "No match")
Parameters
- source_range – The full set of columns you want returned (e.g., [A2:D500]).
- lookup_range – The column to check for the keyword (often the first column in source_range).
- keyword_cell – The cell containing the text fragment you are searching for.
- \"No match\" – An optional message displayed when nothing is found.
Why this is best: it is dynamic, needs no Ctrl + Shift + Enter, works in Microsoft 365 and Excel 2021, and adapts instantly to updated data or changing search terms. Use this approach whenever you have current Excel versions and your dataset is not millions of rows (where Power Query or databases may be preferable).
Alternative quick syntax using a typed keyword instead of a cell reference:
=FILTER(source_range, ISNUMBER(SEARCH("green", lookup_range)))
Parameters and Inputs
-
source_range (Required)
- A contiguous block that includes every column you want returned. The size of this range determines the width of the spilled output. Data types may be text, numbers, or dates—FILTER returns them as they appear.
- Must have the same number of rows as lookup_range.
-
lookup_range (Required)
- Typically a single column range used to evaluate the “cell contains” test.
- Text entries should be free of leading/trailing spaces to avoid false negatives. Consider TRIM or CLEAN preprocessing if your data originates from external systems.
-
keyword_cell or \"keyword\" (Required)
- Can be a direct text string inside double quotes or a cell reference.
- SEARCH/FIND are not case sensitive (SEARCH) or are case sensitive (FIND). Decide which behavior you need.
-
[if_empty] (Optional)
- Third FILTER argument. Use a helpful message such as \"No match\" or leave blank (\"\").
- If omitted, Excel returns the #CALC! error when no matches occur.
-
Data preparation and validation
- Ensure all ranges are on the same worksheet (or use full sheet references).
- Verify lookup_range length equals source_range height.
- Avoid merged cells—FILTER cannot spill properly through them.
- WATCH for wildcard characters *? within your data—they are treated as literal text by SEARCH/FIND, not wildcards.
-
Edge cases
- Empty keyword_cell returns every row because SEARCH finds position 1 in empty strings; protect by wrapping keyword in LEN().
- International characters: SEARCH is not case sensitive but still respects accent marks; test thoroughly if using diacritics.
Step-by-Step Examples
Example 1: Basic Scenario – Pull Products Containing “Green”
Data Setup
In [A1:C12] create a simple table:
| A | B | C |
|---|---|---|
| Product | Category | Unit Price |
| Green T-Shirt | Apparel | 15 |
| Blue T-Shirt | Apparel | 14 |
| Dark-Green Hoodie | Apparel | 35 |
| Red Mug | Home | 8 |
| Green Mug | Home | 9 |
| Light-Green Bottle | Outdoor | 12 |
| Black Hat | Apparel | 11 |
| Neon-Green Shorts | Apparel | 19 |
| Blue Bottle | Outdoor | 10 |
| Green Hoodie | Apparel | 32 |
Place the search term “green” in E2, and in G2 enter the formula:
=FILTER(A2:C12, ISNUMBER(SEARCH(E2, A2:A12)), "No match")
Step-by-Step Walkthrough
- SEARCH(E2, A2:A12) scans each product name. It returns an array like [1;#VALUE!;6;#VALUE!;1;7;#VALUE!;6;#VALUE!;1].
- ISNUMBER converts that into TRUE/FALSE: [TRUE;FALSE;TRUE;FALSE;TRUE;TRUE;FALSE;TRUE;FALSE;TRUE].
- FILTER keeps rows where TRUE aligns, spilling all columns for those rows into G2:I7.
Expected Result
Rows containing “Green T-Shirt”, “Dark-Green Hoodie”, “Green Mug”, “Light-Green Bottle”, “Neon-Green Shorts”, and “Green Hoodie” appear instantly.
Why This Works
SEARCH locates text irrespective of case; by wrapping with ISNUMBER you create a Boolean mask FILTER can use. Because our source_range [A2:C12] equals lookup_range height, no mismatch errors occur.
Variations
- Switch E2 to “Mug” to return all mugs.
- Use FIND for case sensitivity: only exact case “Green” would match.
- Add more columns (e.g., stock levels) by expanding source_range to [A2:D12]; results spill wider automatically.
Troubleshooting Tips
If you see #CALC!, ensure no merged cells block the spill range. If no rows appear, double-check spelling in E2 or wrap keyword with TRIM to remove accidental spaces.
Example 2: Real-World Application – Extract Support Tickets Mentioning “Refund” Across Departments
Business Context
A customer support center logs tickets in a master sheet. Management wants a live list of every ticket that mentions the word “refund,” regardless of department, so financial analysts can estimate refund liability.
Sample Data (simplified) in [A1:E25]:
| Ticket ID | Open Date | Department | Status | Description |
|---|---|---|---|---|
| 1001 | 03-Jan-23 | Billing | Closed | Customer requests refund for order 889 |
| 1002 | 03-Jan-23 | Tech | Closed | App crash during login |
| 1003 | 04-Jan-23 | Billing | Open | Billing address invalid |
| … | … | … | … | … |
Assume 24 more rows up to row 25.
Implementation
- Put “refund” in H2.
- Position the output header row (I1:M1) mirroring Ticket ID, Open Date, Department, Status, Description.
- In I2 enter:
=FILTER(A2:E25, ISNUMBER(SEARCH(H2, E2:E25)), "No matching tickets")
- Format columns as needed.
Detailed Explanation
- Lookup_range is E2:E25 because “Description” holds free-text narratives.
- source_range is [A2:E25] so analysts see the full ticket record.
- The include array size equals 24 rows, matching source_range height.
Solving the Business Problem
With this single formula, finance staff always view an up-to-date list of refund mentions, even when front-line agents add new tickets. No filter refresh or VBA macro required. You can now:
- Point a PivotTable to I1:M? to summarize refund counts by status.
- Add conditional formatting highlighting “Open” items.
- Copy the same pattern to search for “chargeback”, “delay” or SLA keywords.
Performance Considerations
Even with thousands of tickets, FILTER remains fast because it only evaluates simple Boolean logic. In Microsoft 365 desktop, streaming recalculation prevents noticeable lag. If your dataset climbs above 100,000 rows, consider staging the data in Power Query first, then referencing the transformed table.
Example 3: Advanced Technique – Multiple Keywords with OR Logic
Scenario
A marketing analyst needs a list of all products whose description contains “green” or “blue” for a color-themed promotion. A basic FILTER handles one keyword; accommodating two requires an expanded include array.
Dataset
Use the product table from Example 1. Put “green” in F2 and “blue” in G2.
Formula
=FILTER(A2:C12, (ISNUMBER(SEARCH(F2, A2:A12)) + ISNUMBER(SEARCH(G2, A2:A12)))>0, "No match")
How It Works
- ISNUMBER(SEARCH(F2, A2:A12)) returns TRUE/FALSE for “green”.
- ISNUMBER(SEARCH(G2, A2:A12)) returns TRUE/FALSE for “blue”.
- Adding the two arrays coerces TRUE to 1 and FALSE to 0, so each row sums to 0, 1, or 2.
- The expression greater than 0 converts sums back to TRUE where at least one keyword exists (logical OR).
- FILTER displays every row meeting either condition.
Edge-Case Handling
If one of the keyword cells is blank, the formula would erroneously match all rows. Prevent that by wrapping each SEARCH in IF(LEN(keyword)=0, FALSE, ISNUMBER(...)).
Professional Tips
- For an AND relationship, replace + with * and greater than 0 with =1.
- To allow dynamic keyword lists (e.g., a spill range of search terms), switch to a Lambda helper function or use BYROW/SCAN in Microsoft 365 for custom aggregation.
- Always document complex include arrays with comments or cell notes for future maintainers.
Tips and Best Practices
- Use named ranges for source_range and lookup_range so formulas remain readable and survive column insertions.
- Pre-clean text with TRIM, CLEAN, or PROPER to avoid invisible characters reducing matches.
- For large datasets, convert the source to an Excel Table (Ctrl + T). FILTER referencing a structured table column automatically adapts to new rows.
- If exporting results, wrap FILTER inside SORT to keep matches alphabetized or by date.
- Combine FILTER output with UNIQUE to remove duplicates when looking only for distinct matches.
- Document formula logic in the cell’s Alt+Enter inline comments or in a nearby note for easier auditing.
Common Mistakes to Avoid
- Mismatched Range Sizes – FILTER errors when source_range and include array differ in height. Always reference the same rows.
- Case Sensitivity Assumptions – SEARCH is case insensitive, FIND is not. Choose intentionally; otherwise, “Green” might match when you expected exact case.
- Blank Keyword Behaviour – An empty search string matches every cell. Guard with IF(LEN(keyword)=0,\"\",FILTER(...)).
- Merged Cells Blocking Spill – Spilled arrays cannot overwrite merged cells. Unmerge or move the formula.
- Overwriting Source Data – Place the formula output in a safe area so the spill range never intersects the original dataset.
Alternative Methods
| Method | Excel Version | Pros | Cons | Ideal Use Cases |
|---|---|---|---|---|
| FILTER + SEARCH (main tutorial) | 365, 2021 | Dynamic, short, no helpers | Not available in 2019 or earlier | Everyday filtering tasks under 1 million rows |
| Advanced Filter (Data tab) | All desktop versions | GUI based, no formulas | Manual refresh, cannot auto-expand | One-off tasks, beginner users |
| INDEX + SMALL legacy array | 2010-2021 | Works in older versions | CSE entry, harder to read | Maintaining compatibility with legacy workbooks |
| Power Query | 2016-365 | Handles millions of rows, case transformations | Requires refresh, separate editor | ETL pipelines, heavy data workloads |
| VBA User-Defined Function | All | Full automation, custom rules | Requires macro-enabled file, security prompts | Repetitive batch work, corporate automation |
Choose FILTER when you have Microsoft 365. Resort to INDEX + SMALL for stakeholders on Excel 2010-2019. Use Power Query for very large files or when you need to merge multiple sources before filtering.
FAQ
When should I use this approach?
Use FILTER + SEARCH anytime you need a live, ever-updating list of records containing a keyword or phrase, especially in Microsoft 365 where dynamic arrays are native.
Can this work across multiple sheets?
Yes. Reference ranges with sheet qualifiers like Sheet1!A2:A500. Ensure both the source_range and lookup_range point to the same sheet, or use functions like LET to shorten external references.
What are the limitations?
- Unavailable in Excel 2019 or earlier.
- SEARCH limit: cell text length up to 32,767 characters.
- FILTER spill range cannot overlap the source. Work around by placing the formula on a different sheet.
How do I handle errors?
Wrap FILTER with IFERROR or leverage the third FILTER argument. For example:
=FILTER(A2:C100,ISNUMBER(SEARCH(E2,A2:A100)),"No rows match the keyword")
Does this work in older Excel versions?
Not directly. Replace FILTER with an INDEX + SMALL array formula, or use Advanced Filter. Alternatively, upgrade to Microsoft 365 for dynamic arrays.
What about performance with large datasets?
FILTER is vectorized and efficient up to hundreds of thousands of rows. Over one million rows, Excel may slow; offload heavy lifting to Power Query or a database, then summarize with FILTER on a final table.
Conclusion
Mastering the ability to “get all matches cell contains” turns Excel into a responsive search engine for your spreadsheets. With a few elegant formulas, you can surface every relevant row, power dashboards, and drive decision-making—all without manual filters or code. This skill dovetails with many other dynamic-array techniques, paving the way for interactive models and automation. Keep practicing with your own data, explore variations like multiple keywords or case sensitivity, and soon you will wield Excel’s text-matching capabilities with confidence and speed.
Related Articles
How to Show the 10 Most Common Text Values in Excel
Learn multiple Excel methods to list the 10 most frequent text values—complete with step-by-step examples, business use cases, and expert tips.
How to Abbreviate Names Or Words in Excel
Learn multiple Excel methods to abbreviate names or words with step-by-step examples and practical applications.
How to Abbreviate State Names in Excel
Learn multiple Excel methods to abbreviate state names with step-by-step examples, professional tips, and real-world applications.