Skip to main content
SheetHub Docs
Formulas & Functions3 min read

Excel TEXTJOIN with Conditions: Merge Filtered Strings

Combine text from multiple cells conditionally in Excel using TEXTJOIN, IF, and dynamic array FILTER formulas.

SheetHub3 min
Combining text across multiple rows based on specific conditions used to require complex VBA macros or repetitive CONCATENATE formulas. If you needed a comma-separated list of all project tasks assigned to a specific team member, standard formulas fell short. Excel TEXTJOIN solves this by allowing flexible delimiters, ignoring empty cells, and evaluating logical conditions seamlessly when paired with IF or FILTER. This guide covers how to use =TEXTJOIN() with single and multiple conditions, build dynamic lists, format delimiters, and troubleshoot formula errors.

What is Excel TEXTJOIN and how does it work?

Available in modern Excel, TEXTJOIN merges text strings from multiple ranges or arrays, inserting a specified delimiter between each item.

Syntax

=TEXTJOIN(delimiter, ignore_empty, text1, [text2, ...])
  • delimiter: A text string (such as ", " or " | ") placed between each item.
  • ignore_empty: TRUE (recommended) skips blank cells; FALSE includes extra delimiters for empty cells.
  • text1, text2: Text strings, cell ranges, or array formulas to join.
If you are standardizing text across imported data, review our guide to Excel text functions for splitting and extracting components.

Pattern 1: Conditional text merging with IF

Suppose you have a project task table in A2:B100:
  • Column A: Team Member ("Luis", "Maya", "Erin")
  • Column B: Task Description
To generate a comma-separated list of all tasks assigned to "Maya":
=TEXTJOIN(", ", TRUE, IF(A2:A100="Maya", B2:B100, ""))

How it works:

  1. IF(A2:A100="Maya", B2:B100, ""): Returns the task description when the name matches "Maya", and an empty string "" when it does not.
  2. TRUE: Tells TEXTJOIN to ignore all empty strings generated by non-matching rows.
  3. ", ": Joins only the matching task descriptions with a clean comma separator.

Pattern 2: TEXTJOIN with FILTER for dynamic arrays

In Excel 365, combining TEXTJOIN with the FILTER function is cleaner and faster for large datasets:
=TEXTJOIN(", ", TRUE, FILTER(B2:B100, A2:A100=G2, "No tasks assigned"))
  • If cell G2 contains "Luis", the formula returns only Luis's tasks.
  • If no rows match, the fallback text "No tasks assigned" is displayed.
For complex multi-condition filters that handle blank selector controls, see our Google Sheets and Excel filter optional criteria guide.

Pattern 3: Multi-criteria conditions with AND logic

To list all tasks assigned to "Maya" that are currently marked as "In Progress" in Column C:
=TEXTJOIN(", ", TRUE, FILTER(B2:B100, (A2:A100="Maya") * (C2:C100="In Progress"), "None"))
The multiplication operator * acts as boolean AND logic, ensuring only rows meeting both conditions are joined. To prevent recalculating repetitive array lookups in multi-step reports, assign these extracts to named variables using Excel LET function formulas.

Common errors and troubleshooting

IssueRoot CauseSolution
#VALUE! errorFormula exceeds Excel's 32,767 character limit per cell.Add filters to narrow down the number of concatenated rows.
Extra delimiters appearSecond argument ignore_empty was set to FALSE.Set ignore_empty to TRUE.
#CALC! errorThe FILTER function found no matching records without a fallback.Always provide the 3rd [if_empty] argument in FILTER.

Summary

Combining TEXTJOIN with IF and FILTER provides a powerful, formula-based way to build dynamic summary lists in Excel without macros.

Recommended Next Reading

All Articles

Share this tutorial

Discussion & Community

Share questions, tips, or edge-cases about this spreadsheet formula.

Recommended Next Reading

All Articles