Excel TEXTJOIN Function: Combine Cells with Delimiters and Examples

Excel TEXTJOIN function tutorial featured image

What is TEXTJOIN in Excel?

The TEXTJOIN function combines text from several cells or ranges and places a separator between the pieces. Unlike the ampersand (&) operator, TEXTJOIN can apply the same delimiter to an entire range and optionally ignore empty cells.

TEXTJOIN syntax

=TEXTJOIN(delimiter,ignore_empty,text1,[text2],...)

delimiter is the separator such as ", " or " - ". Set ignore_empty to TRUE to skip empty values or FALSE to retain their positions. The text arguments can be cells, ranges or text strings.

Example 1: Join first and last names

Suppose A2 contains Asha and B2 contains Shah:

=TEXTJOIN(" ",TRUE,A2,B2)

Result: Asha Shah. The delimiter is one space. If B2 is blank, TRUE means the formula returns just Asha rather than an extra separator.

Example 2: Create a comma-separated product list

In cells A2:A5, enter Pen, Notebook, Pencil and Eraser.

=TEXTJOIN(", ",TRUE,A2:A5)

Result: Pen, Notebook, Pencil, Eraser. This is useful for summaries, labels and reports.

Example 3: Build an address

Suppose A2 is Building 7, B2 is Andheri, C2 is Mumbai and D2 is Maharashtra. Use:

=TEXTJOIN(", ",TRUE,A2:D2)

Result: Building 7, Andheri, Mumbai, Maharashtra. Leaving C2 blank still produces a clean list because TRUE skips the empty value.

Example 4: Use line breaks as a delimiter

To place each value on a new line inside one cell:

=TEXTJOIN(CHAR(10),TRUE,A2:A5)

Turn on Wrap Text to display the new lines properly. CHAR(10) is the line-feed character often used for line breaks in Excel cells.

Example 5: Add a label and multiple fields

If A2 contains INV-102 and B2 contains Paid:

=TEXTJOIN(" | ",TRUE,"Invoice",A2,B2)

Result: Invoice | INV-102 | Paid. TEXTJOIN lets you mix fixed labels and cell values.

Example 6: Join values that meet a condition

In Microsoft 365 or an Excel version supporting FILTER, suppose A2:A6 has names, and B2:B6 has the values Yes/No. Join names marked Yes:

=TEXTJOIN(", ",TRUE,FILTER(A2:A6,B2:B6="Yes",""))

The FILTER function selects the matching names, and TEXTJOIN combines them. Availability of FILTER depends on your Excel version.

TEXTJOIN vs CONCAT and &

Use TEXTJOIN when you need a delimiter applied automatically across many values. CONCAT combines values without a built-in delimiter argument. The & operator is simple for two or three fields, but becomes less convenient for long ranges.

Common TEXTJOIN errors

  • #VALUE! for a very long result: Excel cells have a maximum length of 32,767 characters.
  • Extra separators: TRUE skips empty cells; FALSE includes their positions.
  • Missing punctuation: include the space in ", " if you want it after each comma.
  • Dates show serial numbers: wrap dates in TEXT, such as TEXT(A2,"dd mmm yyyy"), when joining formatted values.
  • Regional separators: your Excel settings may require semicolons between arguments.

Frequently asked questions

Can TEXTJOIN ignore blank cells?

Yes. Set its second argument to TRUE.

Can TEXTJOIN use more than one range?

Yes, include additional ranges as later text arguments.

Is TEXTJOIN available in Excel 2016?

TEXTJOIN is supported in Microsoft 365, Excel 2019 and newer perpetual versions, but not in every standalone Excel 2016 installation.

Practice exercise

Create a contact list with First Name, Last Name and City. Join the first and last names with a space; then build one contact summary using commas. Try leaving one field empty and compare TRUE versus FALSE.

Related Excel lessons

Explore Excel Functions tutorials and compare TEXTJOIN with TEXTSPLIT when you need to separate data rather than combine it.

Official Excel documentation

Check the Microsoft Excel help center for version availability and updated function guidance.