Google Sheets Function: TEXTJOIN

The TEXTJOIN function combines the values from one or more cell ranges and allows for the definition of a separator.

Its great advantage over the JOIN function is that it also allows for ignoring empty cells.

Usage:

=TEXTJOIN(delimiter, ignore_empty, text1)

or

=TEXTJOIN(delimiter, ignore_empty, text1, text2, etc)


Example of Use

The goal here is to assemble the non-empty references from the table:

google sheets function textjoin

To get the list of references from the table separated by commas, enter the following information:

The formula here is:

=TEXTJOIN(", ",1,A2:A8)
google sheets function textjoin cells

Assemble and Sort

This function can also be combined with other functions, for example with the SORT function to sort references before assembling them:

=TEXTJOIN(", ",1,SORT(A2:A8))
google sheets function textjoin sort