The TEXTJOIN function
Joins texts with a delimiter between them, and can skip empty cells.
Syntax
TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)- delimiter
- The text to put between items, such as ", ".
- ignore_empty
- TRUE to skip empty cells.
- text1
- The first text, cell or range.
- text2 (optional)
- More texts or ranges.
Examples
D1
=TEXTJOIN(1", ",2TRUE,3A2:A4)| A | B | C | D | |
|---|---|---|---|---|
| 1 | Fruit | Price | Apple, Pear, Plum | |
| 2 | Apple | 4 | ||
| 3 | Pear | 6 | ||
| 4 | Plum | 5 |
In plain words: Join 3the fruit in A2:A4 with 1a comma and a space between them, 2skipping empty cells.
D1=TEXTJOIN("-",TRUE,"DK","","2100")
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Fruit | Price | DK-2100 | |
| 2 | Apple | 4 | ||
| 3 | Pear | 6 | ||
| 4 | Plum | 5 |