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
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
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.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Name | Member code | City | All codes | GB-2041 / SE-1187 / IN-3302 / ES-0419 / TR-2750 / JP-1093 / IT-4468 / DE-3321 | |
| 2 | mara okafor | mara.okafor@example.com | GB-2041 | London | ||
| 3 | JONAS LIND | jonas.lind@example.org | SE-1187 | Malmö | ||
| 4 | priya raman | priya.raman@example.net | IN-3302 | Pune | ||
| 5 | Tomás Ruiz | tomas.ruiz@example.com | ES-0419 | Seville | ||
| 6 | elif demir | elif.demir@example.org | TR-2750 | Izmir | ||
| 7 | Kenji MORI | kenji.mori@example.net | JP-1093 | Osaka | ||
| 8 | sofia rossi | sofia.rossi@example.com | IT-4468 | Turin | ||
| 9 | Leo Brandt | leo.brandt@example.org | DE-3321 | Leipzig |
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. TEXTJOIN: Joins
C2:C9into one piece of text with" / "between the pieces, skipping empty cells.separator=`" / "`: the text to put between the pieces, in quotesignore_empty=`TRUE`: `TRUE` to skip empty cells, `FALSE` to keep themrange=`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
| Argument | Required | What it is |
|---|---|---|
| delimiter | Yes | What goes between items, in quotes: ", " or " / ". |
| ignore_empty | Yes | TRUE skips empty cells, FALSE keeps them (leaving doubled separators). |
| text1 | Yes | The first item: a range like C2:C9, a cell or text. |
| text2, … | No | More 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.