Menu

TEXTJOIN in Excel: Join a Range with a Delimiter

=TEXTJOIN(", ",TRUE,A2:A6) joins every cell of A2:A6 into one text, with a comma and a space between items and empty cells skipped. Add FILTER to join only the rows that match a condition.

Every sheet on this page is live: change a number or a formula and it recalculates.

=TEXTJOIN(", ",TRUE,A2:A6) joins every cell in A2:A6 into one text, with a comma and a space between the items. The first argument is the delimiter, the second says whether to skip empty cells, and everything after it is the text to join.

Join a column into one cell
C2
ABC
1TeamMembers
2AnaAna, Ben, Chen, Dara, Eli
3Ben
4Chen
5Dara
6Eli
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Clear one of the names in column A: C2 updates and never leaves a double comma. TEXTJOIN needs Excel 2019 or later (including Microsoft 365); in Excel 2016 it shows #NAME?.

TEXTJOIN syntax

=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)
  • delimiter: the text placed between items, in quotes. ", ", "; ", " | ", "-" or "" for nothing.
  • ignore_empty: TRUE skips empty cells, FALSE keeps them, so two delimiters sit side by side.
  • text1, text2, ...: cells, ranges, or text in quotes. Up to 252 of them, and ranges can be rows, columns or blocks.

Skip blank cells with ignore_empty

TRUE skips blanks, FALSE keeps them
C2
ABC
1SizeResult
2SS, M, L, XL
3S, , M, L, , XL
4M
5L
6
7XL
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

C2 gives S, M, L, XL. C3 keeps the two empty cells and shows the gaps as , ,. Use FALSE only when the position of each item matters, for example when the list is read back by another tool.

The same idea fixes full names with an optional middle name. =A2&" "&B2&" "&C2 leaves two spaces when B2 is empty; TEXTJOIN with a space as the delimiter and TRUE does not:

Full name with an optional middle name
D2
ABCD
1FirstMiddleLastFull name
2AnaMariaSilvaAna Maria Silva
3BenOkaforBen Okafor
4ChenLiWuChen Li Wu
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.
Join the order numbers
C2
ABC
1OrderList
21041
31042
4
51045
61046
7
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: In C2, join the order numbers in A2:A7 into one cell, separated by a comma and a space, without gaps for the empty cells.

TEXTJOIN with a condition

To join only the rows that match, put FILTER inside TEXTJOIN. FILTER returns the matching names and TEXTJOIN joins them:

Names in the North region
E2
ABCDE
1NameRegionRegionNames
2AnaNorthNorthAna, Chen, Eli
3BenSouthAna, Chen, Eli
4ChenNorthRegionsNorth, South, East
5DaraEast
6EliNorth
7FaySouth
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Change D2 to South and both formulas list Ben and Fay. E2 uses FILTER, which needs Excel 2021 or Microsoft 365. E3 is the version for Excel 2019: IF returns the name where the region matches and empty text elsewhere, and TRUE drops the empty texts. In Excel 2019 confirm E3 with Ctrl+Shift+Enter (Cmd+Shift+Enter on a Mac).

Two more combinations people often need:

  • Unique values only: =TEXTJOIN(", ",TRUE,UNIQUE(B2:B7)), in E4, gives North, South, East.
  • Sorted: =TEXTJOIN(", ",TRUE,SORT(FILTER(A2:A7,B2:B7=D2))).

If nothing matches, FILTER returns #CALC! and so does TEXTJOIN. Give FILTER a third argument for that case: FILTER(A2:A7,B2:B7=D2,"none").

The East team
E2
ABCDE
1NameRegionEast team
2AnaNorth
3BenSouth
4ChenEast
5DaraEast
6EliNorth
7FaySouth
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: In E2, list the names whose region is East, separated by a comma and a space.

Join dates and numbers with their format

TEXTJOIN joins the stored value, not what the cell shows. A date joins as its serial number (2026-03-02 is 46083) and a percentage as a decimal. Convert the range with TEXT inside TEXTJOIN:

Dates in a list
D2
ABCD
1MeetingDateDates
2Kickoff2026-03-0246083, 46097, 46113
3Review2026-03-16Mar 2, Mar 16, Apr 1
4Launch2026-04-01
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

TEXTJOIN vs CONCAT and &

TEXTJOINCONCAT&
Joins a rangeYesYesNo, one cell at a time
Puts a delimiter between itemsYes, once for allNoYou type it each time
Skips empty cellsYes, with TRUENoNo
Oldest versionExcel 2019Excel 2019Every version

For two or three cells & is the quickest; see concatenate. For a list of any length, TEXTJOIN. One limit to know: a cell holds at most 32,767 characters, and TEXTJOIN returns #VALUE! when the joined text is longer.

Frequently Asked Questions

What does TEXTJOIN do in Excel?

It joins text from cells or ranges and puts a delimiter between the items: =TEXTJOIN(", ",TRUE,A2:A6) turns five cells into one comma-separated list. The second argument, TRUE, skips empty cells.

How do I use TEXTJOIN with a condition?

Give it a FILTER: =TEXTJOIN(", ",TRUE,FILTER(A2:A7,B2:B7="North")) joins only the names whose region is North. In Excel 2019, which has no FILTER, use =TEXTJOIN(", ",TRUE,IF(B2:B7="North",A2:A7,"")) confirmed with Ctrl+Shift+Enter.

Which Excel versions have TEXTJOIN?

Excel 2019, Excel 2021 and Microsoft 365, plus Excel for the web. In Excel 2016 and older it shows #NAME?; join with & there. Google Sheets also has TEXTJOIN.

Why does TEXTJOIN show numbers instead of dates?

TEXTJOIN joins the stored value, and a date is stored as a serial number. Convert the dates first: =TEXTJOIN(", ",TRUE,TEXT(B2:B4,"mmm d")).

Coddy programming languages illustration

Learn to code with Coddy

GET STARTED