TEXTJOIN in Excel: join a whole column with commas
TEXTJOIN takes a range of cells and glues them into one cell with a separator you choose. Perfect for turning a column of names into “Ana, Raj, Lee”.
The formula
=TEXTJOIN(separator, skip_blanks, range)
Steps
- Names in A1:A3.
- Click B1.
- Type
=TEXTJOIN(", ", TRUE, A1:A3), press Enter.
Result: Ana, Raj, Lee.
What each part does
", "— the separator. Use"; "," - ", orCHAR(10)for a new line (turn on Wrap Text to see it).TRUE— skip empty cells.FALSEwould give “Ana, , Lee” if A2 were blank.A1:A3— the range. Can be a whole column:A:A.
Join only the rows that match
Names in A, city in B. Join only the Pune names:
=TEXTJOIN(", ", TRUE, IF(B1:B10="Pune", A1:A10, ""))
In Excel 365 press Enter. In Excel 2019 press Ctrl + Shift + Enter.
Check it worked
Count the commas: there should be one fewer than the number of names.
Needs Excel 2019 or newer
#NAME? means your Excel is older. Use & or CONCATENATE instead.