formulastreak

Text function

TEXTJOIN function in Google Sheets and Excel

TEXTJOIN joins text from several cells or ranges into one, with a separator you choose, and can skip empty cells.

Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet

Syntax

TEXTJOIN(delimiter, ignore_empty, text1, [text2], …)

Arguments in [brackets] are optional. Google Sheets writes it TEXTJOIN(delimiter, ignore_empty, text1, [text2], …).

Example

=TEXTJOIN(" / ",TRUE,C2:C9) reads: Join the member codes C2:C9 into one cell, with " / " between them, skipping empty cells.

Workshop sign-ups · edit F1 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultF1 = GB-2041 / SE-1187 / IN-3302 / ES-0419 / TR-2750 / JP-1093 / IT-4468 / DE-3321
ABCDEF
1NameEmailMember codeCityAll codesGB-2041 / SE-1187 / IN-3302 / ES-0419 / TR-2750 / JP-1093 / IT-4468 / DE-3321
2 mara okafor mara.okafor@example.comGB-2041London
3JONAS LINDjonas.lind@example.orgSE-1187Malmö
4priya ramanpriya.raman@example.netIN-3302Pune
5Tomás Ruiz tomas.ruiz@example.comES-0419Seville
6elif demirelif.demir@example.orgTR-2750Izmir
7 Kenji MORIkenji.mori@example.netJP-1093Osaka
8sofia rossisofia.rossi@example.comIT-4468Turin
9Leo Brandtleo.brandt@example.orgDE-3321Leipzig

F1 shows GB-2041 / SE-1187 / IN-3302 / ES-0419 / TR-2750 / JP-1093 / IT-4468 / DE-3321: all eight member codes in one cell.

How the spreadsheet calculates it

Joins C2:C9 into one piece of text with " / " between the pieces, skipping empty cells.

  1. 1. TEXTJOIN: Joins C2:C9 into one piece of text with " / " between the pieces, skipping empty cells.
    • separator = `" / "`: the text to put between the pieces, in quotes
    • ignore_empty = `TRUE`: `TRUE` to skip empty cells, `FALSE` to keep them
    • range = `C2:C9`: the cells to join

More TEXTJOIN examples

  • =TEXTJOIN(", ",TRUE,A2:A6)Every item in one cell, separated by commas.
  • =TEXTJOIN(" / ",TRUE,C2:C9)Member codes separated by slashes.
  • =TEXTJOIN(", ",TRUE,FILTER(A2:A9,B2:B9="North"))Only the North reps' names (Excel 2021 or later).

Paste any of these into the formula explainer to see it step by step.

Tips

  • Set ignore_empty to TRUE unless empty items are meaningful, to avoid doubled separators.
  • Use CHAR(10) as the delimiter, with Wrap Text on, to put each item on its own line in one cell.
  • Wrap numbers and dates in TEXT before joining so they keep their format.
  • Combine it with FILTER (Excel 2021 or later) to join only the items that meet a condition.

What TEXTJOIN is used for

Listing every city, email or code in one cell for a summary, building comma-separated values for another system, and joining only the items that meet a condition with FILTER.

Arguments

ArgumentRequiredWhat it is
delimiterYesWhat goes between items, in quotes: ", " or " / ".
ignore_emptyYesTRUE skips empty cells, FALSE keeps them (leaving doubled separators).
text1YesThe first item: a range like C2:C9, a cell or text.
text2, …NoMore items.

Common mistakes

  • Forgetting the TRUE/FALSE argument: TEXTJOIN needs all three.

  • Expecting it in Excel 2016 or older (it arrived in Excel 2019).

  • Joining numbers that need a format: wrap them in TEXT first.

In Google Sheets

Google Sheets has TEXTJOIN with the same arguments in the same order.

Errors you may see with TEXTJOIN

  • #NAME?: The file is open in Excel 2016 or older.

Questions

TEXTJOIN, CONCAT or &?

TEXTJOIN for lists with a separator; & for a few pieces. See CONCAT vs CONCATENATE vs TEXTJOIN.

Can TEXTJOIN join only the cells that meet a condition?

Yes, with a condition that returns blanks for the rest: in Excel 2021 or later, TEXTJOIN(", ", TRUE, FILTER(A2:A9, B2:B9="North")).

Is there a length limit?

Microsoft's TEXTJOIN page says the result can't be longer than 32,767 characters, the cell limit; past that it returns #VALUE!.

How do I join with a line break?

Use CHAR(10) as the delimiter and turn on Wrap Text for the cell: TEXTJOIN(CHAR(10), TRUE, A2:A6).

Sources

Official documentation the facts on this page were checked against.

Practise TEXTJOIN on a live sheet

Lesson 25, Join text and TEXT() (Unit 6, Text and dates), has 5 graded exercises, checked instantly, with steps and hints when you're stuck. Pro