Text function

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], ...)
ArgumentWhat it means
delimiterRequiredText placed between items, e.g. ", ". Can be an array to cycle through several delimiters.
ignore_emptyRequiredTRUE skips empty cells; FALSE includes them (producing double delimiters).
text1RequiredThe first item or range to join.
text2, ...OptionalMore 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

C2fx=TEXTJOIN(", ",TRUE,A2:A5)
ABC
1Product
2PensPens, Paper, Toner
3
4Paper
5Toner

Result: Pens, Paper, Toner

The empty A3 is ignored, so there is no doubled comma.

2Address with an optional line

E2fx=TEXTJOIN(", ",TRUE,A2:D2)
ABCDE
1StreetLine 2CityPostcode
212 Baker StreetLondonNW1 6XE12 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

D2fx=TEXTJOIN(", ",TRUE,IF(B2:B5="North",A2:A5,""))
ABCD
1NameRegion
2AnaNorthAna, Chen
3BenSouth
4ChenNorth
5DinaEast

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

D2fx=TEXTJOIN("|",FALSE,A2:C2)
ABCD
1IDNoteStatus
2ID7PaidID7||Paid

Result: ID7||Paid

With ignore_empty FALSE the blank note still gets its slot, which import files with fixed columns need.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 18 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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 when ignore_empty is 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.

LanguageFunction name
DanishTEKST.KOMBINER
DutchTEKST.COMBINEREN
FinnishTEKSTI.YHDISTÄ
FrenchJOINDRE.TEXTE
GermanTEXTVERKETTEN
HungarianSZÖVEGÖSSZEFŰZÉS
ItalianTESTO.UNISCI
Norwegian (Bokmål)TEKST.KOMBINER
PolishPOŁĄCZ.TEKSTY
Portuguese (Brazil)UNIRTEXTO
Portuguese (Portugal)UNIRTEXTO
RussianОБЪЕДИНИТЬ
SpanishUNIRCADENAS
TurkishMETİNBİRLEŞTİR

Recipes that use TEXTJOIN