fxExcelReps
← All functions Aa Text · Intermediate

TEXTJOIN Join a whole range with a separator.

How to use TEXTJOIN in Excel

TEXTJOIN joins a whole range with a separator between the items and can skip empty cells — perfect for lists like "Ivan, Maria, Elena".

Syntax

=TEXTJOIN(delimiter, ignore_empty, text1, ...)

delimiterWhat to put between items, e.g. ", ".
ignore_emptyTRUE to skip empty cells.
text1, …The cells or ranges to join.

Examples

=TEXTJOIN(", ", TRUE, A2:A20)Comma-separated list of names.
=TEXTJOIN("-", TRUE, A2, B2, C2)Build a code like "BG-1024-SOF".
=TEXTJOIN(", ", TRUE, IF(B2:B20="Sofia", A2:A20, ""))Names of everyone from Sofia.

A list in one cell for an email or a report

TEXTJOIN puts a separator between the values for you and, with TRUE, skips empty cells, so you never get "A, , B".

=TEXTJOIN(", ", TRUE, A2:A30)All the account IDs in one line, ready to paste into an email.
=TEXTJOIN(CHAR(10), TRUE, A2:A10)One item per line in a single cell (turn on Wrap Text).

Join only the rows that match

Give TEXTJOIN a list that already has the condition in it: IF keeps the value when the row matches and returns empty text otherwise.

=TEXTJOIN(", ", TRUE, IF(C2:C100="Overdue", A2:A100, ""))Every client with an overdue invoice.
=TEXTJOIN(", ", TRUE, UNIQUE(FILTER(B2:B100, C2:C100="Overdue")))The same, without repeats (Microsoft 365).

Build an address or a full name

When some parts may be missing, TEXTJOIN with TRUE leaves out the empty ones and their separators.

=TEXTJOIN(", ", TRUE, B2, C2, D2, E2)Street, city, postcode, country: no double commas when one is blank.

Common mistakes

Double separators
With FALSE as the 2nd argument, empty cells produce ", , ". Use TRUE.
#NAME? in older Excel
Needs Excel 2019 or Microsoft 365.

Frequently asked questions

Which Excel versions have TEXTJOIN?

Excel 2019, Excel 2021, Microsoft 365 and Excel for the web. Older versions show #NAME?; join the cells with & there.

What does TRUE mean in TEXTJOIN?

Ignore empty cells. With FALSE, every empty cell still gets a separator, so you see things like "A, , , B".

Is there a limit to how much TEXTJOIN can join?

The result can be up to 32,767 characters, the limit of one cell. Longer results return #VALUE!.

How do I split the text back into cells?

Use Data → Text to Columns, or TEXTSPLIT in Microsoft 365: =TEXTSPLIT(A2, ", ").

Available in: Excel 2019, 2021, Microsoft 365, Excel for the web

Related functions

CONCATSUBSTITUTE

↑ Practise TEXTJOIN in the sheet above