Formulas & Functions•3 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.
SheetHub••3 min
Combining text across multiple rows based on specific conditions used to require complex VBA macros or repetitive
Available in modern Excel,
Suppose you have a project task table in
In Excel 365, combining
To list all tasks assigned to
The multiplication operator
Combining
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?
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;FALSEincludes extra delimiters for empty cells. - text1, text2: Text strings, cell ranges, or array formulas to join.
Pattern 1: Conditional text merging with IF
A2:B100:
- Column A: Team Member (
"Luis","Maya","Erin") - Column B: Task Description
"Maya":
=TEXTJOIN(", ", TRUE, IF(A2:A100="Maya", B2:B100, ""))How it works:
IF(A2:A100="Maya", B2:B100, ""): Returns the task description when the name matches"Maya", and an empty string""when it does not.TRUE: TellsTEXTJOINto ignore all empty strings generated by non-matching rows.", ": Joins only the matching task descriptions with a clean comma separator.
Pattern 2: TEXTJOIN with FILTER for dynamic arrays
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
G2contains"Luis", the formula returns only Luis's tasks. - If no rows match, the fallback text
"No tasks assigned"is displayed.
Pattern 3: Multi-criteria conditions with AND logic
"Maya" that are currently marked as "In Progress" in Column C:
=TEXTJOIN(", ", TRUE, FILTER(B2:B100, (A2:A100="Maya") * (C2:C100="In Progress"), "None"))* 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
| Issue | Root Cause | Solution |
|---|---|---|
#VALUE! error | Formula exceeds Excel's 32,767 character limit per cell. | Add filters to narrow down the number of concatenated rows. |
| Extra delimiters appear | Second argument ignore_empty was set to FALSE. | Set ignore_empty to TRUE. |
#CALC! error | The FILTER function found no matching records without a fallback. | Always provide the 3rd [if_empty] argument in FILTER. |
Summary
TEXTJOIN with IF and FILTER provides a powerful, formula-based way to build dynamic summary lists in Excel without macros.Article Topics
Recommended Next Reading
Excel
=EXCEL(...)Excel ROUND Function: MROUND, CEILING & FLOOR Guide
Explore ↗
Excel
=EXCEL(...)Excel LAMBDA Recursive Loops: Advanced Calculations
Explore ↗
Excel
=EXCEL(...)Excel REGEXEXTRACT: Extract Patterns and Substrings
Explore ↗
Share this tutorial
Discussion & Community
Share questions, tips, or edge-cases about this spreadsheet formula.