The TEXTJOIN function in Excel
TEXTJOIN combines many cells into one text, putting a separator of your choice between them: a comma-separated list of names, a path, a full address. Unlike & or CONCAT, it takes a whole range and can leave out empty cells.
Available in Excel 2019 and newer, including Excel 365.
Syntax
=TEXTJOIN(delimiter, ignore_empty, text1, [text2], …)
| Argument | What it means |
|---|---|
| delimiter | What to put between the items, e.g. ", ". |
| ignore_empty | TRUE skips empty cells; FALSE keeps them (leaving double separators). |
| text1, … | The cells, ranges or texts to join. |
Examples
1. A list from a range
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Tag | Everyone | |
| 2 | Maya | red | Maya, Omar, Lena | |
| 3 | Omar | |||
| 4 | Lena | large |
One range, one separator. With & you'd write =A2&", "&A3&", "&A4.
2. Skip empty cells
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Tag | Tags | |
| 2 | Maya | red | red, large | |
| 3 | Omar | |||
| 4 | Lena | large |
Omar has no tag. TRUE leaves the empty cell out, so there's no ", ," in the result.
3. Keep empty cells
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Tag | Tags (with gaps) | |
| 2 | Maya | red | red, , large | |
| 3 | Omar | |||
| 4 | Lena | large |
FALSE keeps a slot for every cell, which is useful when the position matters.
Common mistakes
Numbers lose their formatting. Dates turn into serial numbers like 46099 and 3.50 into 3.5.
Fix: Format them inside the formula with TEXT, e.g. TEXT(C2,"yyyy-mm-dd").
#NAME? error in Excel 2016 or older, which don't have TEXTJOIN.
Fix: Join with & instead in files for older versions.
Frequently asked questions
How do I put each item on a new line?
Use CHAR(10) as the delimiter and turn on Wrap Text for the cell: =TEXTJOIN(CHAR(10),TRUE,A2:A4).
Related functions
- CONCATENATECONCATENATE, CONCAT and the & operator join text from several cells into one, like first and last name.
- TEXTTEXT turns a number or date into text in the format you choose, such as 2 decimals, 12,500 or 2026-03-18.
- TRIMTRIM removes extra spaces from text: at the start, at the end, and doubles between words.