Text
Joining cells into one list
Definition
Joining several cells into one list with a chosen separator means giving TEXTJOIN the separator, whether to skip blanks, and the cells.
Syntax
=TEXTJOIN(delimiter, ignore_empty, text1)
Arguments
| Argument | Meaning |
|---|---|
delimiter |
The separator to place between items, in double quotes, for example "|". |
ignore_empty |
1 skips empty cells. 0 keeps a separator for each empty cell. |
text1 |
The cells to join. A range such as A2:C2 is allowed. |
Worked example
A crate list stores wood types across A2:C2. The middle cell is empty.
| A: First | B: Second | C: Third |
|---|---|---|
| oak | elm |
Formula: =TEXTJOIN("|",1,A2:C2)
Result: oak|elm. The empty cell is skipped, so only one separator is used.
Practice
Cells A2, B2, and C2 hold red, blue, and green. In D2, write a formula that joins those cells with a hyphen, skipping empty cells.
- In D2, write a TEXTJOIN formula that joins A2:C2 with a hyphen and ignores empty cells.
- D2 should show A2:C2 joined with hyphens, skipping blanks.
Related functions
TEXTJOIN is the function that builds that list with the separator you choose.
Common mistake
Using 0 for empty cells, as in =TEXTJOIN("|",0,A2:C2): the blank in B2 is kept, so the result is oak||elm.