What you will learn
- Join a range with a separator
- Skip empty cells
How it works
=TEXTJOIN(", ",TRUE,A2:A6) joins A2 to A6 with a comma and a space.
Note: TEXTJOIN works in Excel 2019 and newer, and in Microsoft 365. In older Excel it shows #NAME?. Use & to join the cells one by one instead.
Formulas at a glance
=TEXTJOIN(", ",TRUE,A2:A6) | Ana, Ben, … |
Example
Write the formula to join all the names with a comma and a space.
| A | B | C | |
|---|---|---|---|
| 1 | Name | Snack | |
| 2 | Ana | Chips | All names |
| 3 | Ben | Apple | All snacks |
| 4 | Cleo | Grapes | |
| 5 | Dev | Popcorn | First 3 names |
| 6 | Eli | Pretzels | Last 2 snacks |
Click D2 and type =TEXTJOIN(", ",TRUE,A2:A6), then press Enter.
The answer is Ana, Ben, Cleo, Dev, Eli.
When to use it
- A list of names in one cell
- Joining tags or categories
- Making a short summary of a column
Common mistakes
- Seeing #NAME?TEXTJOIN needs Excel 2019 or newer, or Microsoft 365. Use & in older Excel.
- Getting extra commasUse TRUE as the second part to skip empty cells.
- Forgetting the space in the separatorWrite ", " with a space after the comma.
Practice it on a real sheet
Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.