TEXTJOIN function
Joins text from ranges or values with a delimiter between each item, optionally skipping empty cells.
Available in Microsoft 365, Excel 2019 and later, Excel for the web
Excel 2019 and laterWorks in Google Sheets
Syntax
TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)| Argument | What it means | |
|---|---|---|
delimiter | Required | Text placed between items, e.g. ", ". Can be an array to cycle through several delimiters. |
ignore_empty | Required | TRUE skips empty cells; FALSE includes them (producing double delimiters). |
text1 | Required | The first item or range to join. |
text2, ... | Optional | More items or ranges, up to 252. |
Returns: One text string.
How TEXTJOIN works
TEXTJOIN is the most practical way to combine a list into one cell. You give it the separator once, tell it whether to skip blanks, and point it at one or more ranges: =TEXTJOIN(", ",TRUE,A2:A20) turns a column of product names into Pens, Paper, Toner. No more chains of &", "&.
The ignore_empty switch is what makes it so handy for addresses and lists with gaps: optional fields that are blank simply disappear instead of leaving , , behind. Combined with IF or FILTER (in Microsoft 365) it can join only the items that meet a condition, such as all staff in one region - a task that used to need VBA.
Like all joining functions it uses stored values, so format numbers and dates with TEXT first. The result is limited to 32,767 characters; beyond that TEXTJOIN returns #VALUE!.
Examples
1Comma-separated list, skipping blanks
| A | B | C | |
|---|---|---|---|
| 1 | Product | ||
| 2 | Pens | Pens, Paper, Toner | |
| 3 | |||
| 4 | Paper | ||
| 5 | Toner |
Result: Pens, Paper, Toner
The empty A3 is ignored, so there is no doubled comma.
2Address with an optional line
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Street | Line 2 | City | Postcode | |
| 2 | 12 Baker Street | London | NW1 6XE | 12 Baker Street, London, NW1 6XE |
Result: 12 Baker Street, London, NW1 6XE
The empty Line 2 is skipped, giving a clean one-line address.
3Join only the staff in one region
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Region | ||
| 2 | Ana | North | Ana, Chen | |
| 3 | Ben | South | ||
| 4 | Chen | North | ||
| 5 | Dina | East |
Result: Ana, Chen
IF returns the name for North rows and empty text for the others; TEXTJOIN skips the empties. (In Excel 2019 confirm with Ctrl+Shift+Enter.)
4Keep empty positions for a fixed layout
| A | B | C | D | |
|---|---|---|---|---|
| 1 | ID | Note | Status | |
| 2 | ID7 | Paid | ID7||Paid |
Result: ID7||Paid
With ignore_empty FALSE the blank note still gets its slot, which import files with fixed columns need.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | The result is longer than 32,767 characters. | Join fewer cells or split the output. |
#NAME? | Used in Excel 2016 or older. | Use CONCATENATE with & separators, or upgrade. |
Tips
- To put each item on its own line in one cell, use
CHAR(10)as the delimiter and turn on Wrap Text. - Combine with UNIQUE and SORT in Microsoft 365:
=TEXTJOIN(", ",TRUE,SORT(UNIQUE(A2:A50))). - Cells containing a formula that returns
""count as empty whenignore_emptyis TRUE.
Questions
What is the difference between TEXTJOIN and CONCAT?
CONCAT glues items together with nothing between them; TEXTJOIN inserts a delimiter between each item and can skip blank cells.
How do I join values that meet a condition?
In Microsoft 365: =TEXTJOIN(", ",TRUE,FILTER(A2:A50,B2:B50="North")). In Excel 2019 use IF inside TEXTJOIN as an array formula.
Can TEXTJOIN put line breaks between items?
Yes: use CHAR(10) as the delimiter and switch on Wrap Text for the cell.
Google Sheets
TEXTJOIN also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
TEXTJOIN in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | TEKST.KOMBINER |
| Dutch | TEKST.COMBINEREN |
| Finnish | TEKSTI.YHDISTÄ |
| French | JOINDRE.TEXTE |
| German | TEXTVERKETTEN |
| Hungarian | SZÖVEGÖSSZEFŰZÉS |
| Italian | TESTO.UNISCI |
| Norwegian (Bokmål) | TEKST.KOMBINER |
| Polish | POŁĄCZ.TEKSTY |
| Portuguese (Brazil) | UNIRTEXTO |
| Portuguese (Portugal) | UNIRTEXTO |
| Russian | ОБЪЕДИНИТЬ |
| Spanish | UNIRCADENAS |
| Turkish | METİNBİRLEŞTİR |
Recipes that use TEXTJOIN
- How to combine first and last name in Excel
- How to extract numbers from text in Excel
- How to remove line breaks in Excel
- How to return multiple matches in Excel