How to Extract Common Values From Text Strings in Excel

Learn multiple Excel methods to extract common values from text strings with step-by-step examples, real-world use cases, and expert tips.

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

How to Extract Common Values From Text Strings in Excel

Why This Task Matters in Excel

Imagine receiving a weekly report from your sales team that lists product codes sold in each region. Each regional manager summarizes sales in a single cell such as “A12, A17, B03, F55”. Your job in headquarters is to identify which product codes appear in all regions so the manufacturing team can prioritize those items for restocking. Situations like this—where you must compare two or more text strings that each contain multiple, delimiter-separated values—appear in countless business contexts:

  • Marketing teams comparing customer segments that opened both email campaigns
  • Inventory clerks finding SKUs stocked in multiple warehouses
  • HR specialists identifying employees who completed all required trainings
  • IT auditors matching lists of permissions granted by separate systems

Without a quick way to extract the shared values, analysts resort to copying data into separate columns, writing ad-hoc scripts, or doing error-prone manual checks. Excel excels at reshaping, comparing, and recombining data; learning to extract common values from text strings therefore multiplies your productivity across reporting, reconciliation, and data-quality tasks.

Several Excel functions lend themselves to this objective. Recent versions of Microsoft 365 provide dynamic array functions like TEXTSPLIT, FILTER, UNIQUE, and TEXTJOIN, letting you accomplish the job with a single spill formula that automatically expands to show every common item. In older versions you can deploy more manual formulas with SEARCH + ISNUMBER inside arrays, or take a code-free detour with Power Query. Regardless of your Excel edition, knowing this skill means you can:

  1. Reconcile lists in seconds rather than hours
  2. Reduce avoidable errors that occur with manual copy-paste comparisons
  3. Integrate clean, deduplicated lists into dashboards and downstream calculations
  4. Present clear, concise results (for example, “Common SKUs: A12, B03”) that everyone understands

Failing to master this task wastes time, breeds inaccuracies, and leaves crucial overlap unseen—potentially costing money in ordering, marketing, or compliance environments. Because text lists are everywhere—cells, CSV exports, web scrapes—this technique connects directly to data-cleaning, lookups, and dynamic report building, three pillars of advanced Excel workflows.

Best Excel Approach

In Microsoft 365 the fastest, most transparent method combines TEXTSPLIT to convert each delimited string into an array, FILTER + MATCH to keep only values present in both arrays, UNIQUE to remove duplicates, and TEXTJOIN to reassemble the overlap into a single, readable string. When the source strings live in cells [A2] and [B2] and are separated by commas, one formula delivers the full answer:

=TEXTJOIN(
  ", ",
  TRUE,
  UNIQUE(
    FILTER(
      TEXTSPLIT(A2,", "),
      ISNUMBER(
        MATCH(
          TEXTSPLIT(A2,", "),
          TEXTSPLIT(B2,", "),
          0
        )
      )
    )
  )
)

Why this approach is best:

  • Single cell solution – no helper columns, updates automatically
  • Dynamic – spill ranges resize when source strings grow
  • Readable – each function plays a clear role (split, filter, deduplicate, join)
  • Non-volatile – minimal recalc overhead even in large sheets

Use it when both prerequisites are true:

  1. You have Microsoft 365 or Excel 2021 with dynamic arrays.
  2. Source lists share a common delimiter (comma, semicolon, pipe, or custom).

If those conditions are not met or you need cross-sheet joins on thousands of rows, alternative methods like Power Query or legacy array formulas may serve you better, but the logic remains: split → compare → collect overlaps → present.

Quick Syntax Reference

  • TEXTSPLIT(text, delimiter) – returns an array of substrings
  • MATCH(lookup, lookup_array, 0) – returns positions or #N/A; inside ISNUMBER turns into TRUE/FALSE
  • FILTER(array, include) – keeps elements where include = TRUE
  • UNIQUE(array) – removes duplicates
  • TEXTJOIN(delimiter, ignore_empty, array) – concatenates array items into one text value

Parameters and Inputs

  1. Source strings – typically reside in individual cells such as [A2] and [B2]. They must be plain text; numbers work too since Excel treats them as text once split.
  2. Delimiter – the character(s) that separate values. Common examples include “, ” (comma plus space), “;”, or “|”. Ensure each source string uses the same delimiter or standardize them first with SUBSTITUTE.
  3. Case sensitivity – TEXTSPLIT preserves original case, while MATCH is case-insensitive. If you require case-sensitive matching, replace MATCH with XMATCH(...,,-1,1).
  4. Duplicates within a single string – UNIQUE removes them in the result. If you must report multiple occurrences, omit UNIQUE.
  5. Non-trimmed spaces – leading or trailing spaces create false mismatches. Wrap TEXTSPLIT in TRIM or include a second argument “, ” to discard spaces automatically.
  6. Empty tokens – consecutive delimiters generate empty results. TEXTJOIN’s ignore_empty parameter (set to TRUE) omits them.
  7. Large arrays – keep an eye on calculation time. For lists exceeding roughly 5,000 items per cell, consider Power Query or helper columns to avoid recalculation lag.

Edge cases to validate: blank cells, delimiter missing in one list, non-text values like errors or booleans, and inconsistent capitalization.

Step-by-Step Examples

Example 1: Basic Scenario – Overlapping Color Lists

Suppose two project teams maintain color codes in [A2] and [B2]:

CellValue
A2red, blue, green, orange
B2yellow, green, red, black

Goal: display the colors common to both lists.

Steps:

  1. Click [C2] where you want the answer.
  2. Enter the dynamic formula:
=TEXTJOIN(", ", TRUE, UNIQUE( FILTER( TEXTSPLIT(A2,", "), ISNUMBER( MATCH(TEXTSPLIT(A2,", "), TEXTSPLIT(B2,", "), 0 ) ) ) ) )
  1. Press Enter. Excel spills “green, red”—the shared colors—into [C2].

Why it works:

  • TEXTSPLIT(A2,\", \") → [red, blue, green, orange]
  • MATCH compares each element to the array from TEXTSPLIT(B2,\", \") → positions or #N/A
  • ISNUMBER turns positions into TRUE, #N/A into FALSE → include mask for FILTER
  • FILTER keeps only [green, red]
  • UNIQUE deduplicates (not necessary here but safe)
  • TEXTJOIN reassembles the list.

Variations: switch the delimiter to “; ” or “|”; use a cell reference like [D1] to store the delimiter and replace hard-coded “, ” for greater flexibility.

Troubleshooting: if you see #VALUE! check for stray spaces. Wrapping TEXTSPLIT inside TRIM cleans up “ red ” into “red”.

Example 2: Real-World Application – Common SKUs in Multi-Region Sales

Data context: each row represents a region; column [B] lists SKUs sold in Q1, column [C] lists SKUs sold in Q2. You want to populate column [D] with the SKUs that sold in both quarters for that region, then aggregate totals. Sample rows:

RegionQ1 SKUs (B)Q2 SKUs (C)
NorthA12, B03, F55, X90B03, X90, Z77
SouthC01, F55, A12A12, C01, D99
EastB03, K10L20, M30

Steps for row 2 (North):

  1. Select [D2] and use a relative version of the core formula:
=TEXTJOIN(", ", TRUE, UNIQUE( FILTER( TEXTSPLIT(B2,", "), ISNUMBER( MATCH(TEXTSPLIT(B2,", "), TEXTSPLIT(C2,", "), 0 ) ) ) ) )
  1. Copy [D2] downward. Because cell references are relative, each row calculates overlaps for its own lists.
  2. Use COUNTA(TEXTSPLIT(D2,\", \")) in [E2] to count common SKUs.

Business payoff: management immediately sees which products have consistent demand across quarters, enabling agile inventory planning.

Integration with other Excel features:

  • Conditional formatting: highlight regions where the count ≥ 5.
  • PivotTable: summarize SKU counts by region without helper columns.

Performance considerations: on thousands of rows, repeated TEXTSPLIT calls can be heavy. A lighter pattern stores TEXTSPLIT(B2,\", \") in a LET variable to compute it only once per row.

Example 3: Advanced Technique – Three-Way Comparison with Dynamic Range

Scenario: Compliance must find user IDs present in all three security systems. Systems export to cells [A2], [B2], and [C2]. Delimiter is semicolon. Additionally, the lists exceed 2,000 IDs each.

Advanced formula using LET for clarity and performance:

=LET(
  List1, TEXTSPLIT(A2, ";"),
  List2, TEXTSPLIT(B2, ";"),
  List3, TEXTSPLIT(C2, ";"),
  Common12, FILTER(List1, ISNUMBER(MATCH(List1, List2, 0))),
  CommonAll, FILTER(Common12, ISNUMBER(MATCH(Common12, List3, 0))),
  TEXTJOIN("; ", TRUE, UNIQUE(CommonAll))
)

Explanation:

  • LIST1/2/3 hold split arrays only once.
  • COMMON12 extracts overlaps between first two systems.
  • COMMONALL filters that result against the third system.
  • UNIQUE removes any duplicate IDs before concatenation.

Performance optimization: because each TEXTSPLIT executes just once, recalculation time drops dramatically compared with repeated inline TEXTSPLIT. In benchmarks on 2,000-item lists, the LET version ran several times faster.

Edge case handling: if any list is blank, FILTER returns #CALC!. Wrap each List# definition in IF(A\2=\"\",\"\",TEXTSPLIT(A2,\";\")) and adjust logic to exit gracefully.

Professional tips:

  • Replace semicolon with a cell reference to an admin-set delimiter for flexibility.
  • Output CommonAll as a spill range (remove TEXTJOIN) when you need to hand the list to Power Automate or another integration.

Tips and Best Practices

  1. Use LET for readability: assign split arrays to variables so you can walk through logic more easily and recalc once.
  2. Standardize delimiters first: inconsistent delimiters cause mismatches. SUBSTITUTE irregular commas with a single comma plus space.
  3. Trim before split: wrap source strings in TRIM or TEXTSPLIT’s second optional argument to ignore extra spaces.
  4. Expose array output during testing: temporarily drop TEXTJOIN to see the spilled list and verify correctness.
  5. Leverage dynamic named ranges: define Name “SplitA” `=TEXTSPLIT(`Sheet1!$A$2,\", \") to reuse across formulas.
  6. Document in comments: complex one-cell recipes confuse colleagues; insert a Note explaining each step and delimiter assumptions.

Common Mistakes to Avoid

  1. Hard-coding inconsistent delimiters – using “,” in one TEXTSPLIT and “, ” in another produces no matches because of trailing spaces. Remedy: pick one style and apply to all.
  2. Ignoring case requirements – MATCH is case-insensitive. If exact case matters, switch to XMATCH with exact mode.
  3. Omitting UNIQUE when duplicates matter – if your source strings already contain duplicates, failing to deduplicate inflates results.
  4. Overlooking empty strings – a trailing delimiter creates an empty token that may appear in the output. Set TEXTJOIN’s ignore_empty to TRUE or wrap arrays in FILTER(array,array<>\"\").
  5. Copying dynamic formulas into non-dynamic Excel versions – pre-2021 Excel shows #NAME?. Provide alternate approaches for colleagues on older software.

Alternative Methods

When dynamic array functions are unavailable or performance demands different tools, consider these approaches:

MethodVersion SupportProsConsIdeal Use
Helper Columns with SEARCH + ISNUMBERExcel 2010+Works in legacy ExcelRequires extra columns; complex array entrySmall, static datasets
Power Query MergeExcel 2016+No formulas; GUI driven; handles large listsNon-dynamic once loaded; refresh neededThousands of rows; self-service BI
VBA Custom FunctionAll desktop versionsFull control; reusable UDFRequires macros enabled; maintenance overheadRepeated use in template files
Lambda Function RepositoryMicrosoft 365One-click reuse; no macrosWorkspace-specific; newer featureOrganization-wide sharing

Performance comparison:

  • Power Query handles 100k-item lists with minimal memory, but formulas recalc instantly on smaller lists.
  • Helper columns outperform dynamic arrays in pre-365 environments yet clutter the worksheet.
    Choose the method that matches your version, skill level, and data size, and migrate as your environment upgrades.

FAQ

When should I use this approach?

Use it whenever you have two or more text strings containing multiple, delimiter-separated items and you need to know which items appear in all strings. Typical cases include SKU overlap, dual campaign responders, multi-system user reconciliation, and compliance lists.

Can this work across multiple sheets?

Yes. Replace direct cell references with sheet-qualified references, for example TEXTSPLIT(Sheet2!A2,\", \"). All functions accept external sheet or even workbook references, though performance is slightly slower when pulling from closed workbooks.

What are the limitations?

  • Dynamic array formulas require Microsoft 365 or Excel 2021.
  • TEXTSPLIT accepts only a single-character delimiter unless you supply the optional “column_delimiter” and “row_delimiter” arguments.
  • Case-sensitivity defaults to off. Use XMATCH for exact case.
  • Calculation time grows with list length; at extreme volumes Power Query or database tools scale better.

How do I handle errors?

Wrap your main formula in IFERROR. Example: `=IFERROR(`YourFormula, \"No overlap\"). Additionally, test source strings for blanks: IF(A\2=\"\", \"\", YourFormula). FILTER may return #CALC! when no item meets criteria; IFERROR or IFNA resolves this gracefully.

Does this work in older Excel versions?

Pre-2021 Excel lacks TEXTSPLIT, FILTER, and UNIQUE. You can:

  1. Split strings with legacy text functions and helper columns.
  2. Use Power Query as a no-formula alternative.
  3. Install Office Scripts or VBA for a custom function.

What about performance with large datasets?

For lists of up to roughly 5,000 items, dynamic array formulas calculate instantly on modern hardware. Beyond that, LET variables help, but Power Query\'s merge feature becomes more performant because it operates once on load rather than on every worksheet recalc.

Conclusion

Being able to extract common values from text strings turns messy, delimiter-laden data into actionable insights with only a single dynamic formula. Whether you are reconciling product lists, consolidating leads, or enforcing compliance, mastering this technique saves time, reduces errors, and integrates seamlessly with broader Excel skills like dynamic arrays, LET variables, and downstream analysis. Continue practicing by varying delimiters, adding more strings, and experimenting with Power Query so you can choose the most efficient tool for every scenario. Happy data wrangling!

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