TEXTJOIN joins text with a separator between each item. It takes whole ranges, so you can turn a column of names into one comma-separated list in a single formula. It is the tidiest way to build a list, a tag string or an address line.
The arguments
- delimiter is the separator, in quotes.
", " gives red, green, blue. An empty string "" joins with nothing between the items, which makes TEXTJOIN work like CONCAT. - ignore_empty is required.
TRUE leaves out empty cells, so there are no doubled separators. FALSE keeps a separator for every empty cell. In most real lists, you want TRUE. - text1, text2, ... are the items. Each can be a cell, a range or typed text.
=TEXTJOIN(", ",TRUE,A2:A8) joins the whole range with commas and ignores the blanks.
Joining only some items
Because TEXTJOIN accepts arrays, you can join the items that pass a test. In Excel for Microsoft 365, =TEXTJOIN(", ",TRUE,IF(B2:B9>100,A2:A9,"")) lists the names whose value is above 100. The IF gives an empty string for the others, and ignore_empty removes them. In Excel 2019 this formula needs to be entered as an array formula with Ctrl+Shift+Enter.
TEXTJOIN with UNIQUE removes repeats from the list: =TEXTJOIN(", ",TRUE,UNIQUE(C2:C20)). That needs a version with dynamic arrays.
What it returns
TEXTJOIN returns text. Numbers inside the range are joined as they would look in a General-format cell, and dates join as serial numbers, so format them with TEXT first if they must look like dates. If any argument is an error, the result is that error. If the joined text exceeds 32,767 characters, the result is #VALUE!.
TEXTJOIN, CONCAT and the & operator
CONCAT and the ampersand put nothing between items and cannot skip blanks. For a name with an optional middle name, =A2&" "&B2&" "&C2 leaves two spaces in a row when B2 is empty. =TEXTJOIN(" ",TRUE,A2:C2) handles it correctly.
TEXTJOIN does the opposite of TEXTSPLIT: one splits text at a separator into cells, the other joins cells with a separator into text.
Line breaks
To put each item on its own line inside the cell, use CHAR(10) as the delimiter and turn on Wrap Text for the cell: =TEXTJOIN(CHAR(10),TRUE,A2:A5).