ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 49 · Working with text

TEXTJOIN in Excel

TEXTJOIN joins a whole range of cells with a separator, like a comma and a space. =TEXTJOIN(", ",TRUE,A2:A6) turns a column of names into one line.

Practice this lesson →Pro lesson. The first 4 lessons are free.

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.

ABC
1NameSnack
2AnaChipsAll names
3BenAppleAll snacks
4CleoGrapes
5DevPopcornFirst 3 names
6EliPretzelsLast 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.

TEXTJOIN in Excel: how it works, with examples · ExcelUnpack