Google Sheets Function: JOIN
The JOIN function combines the values from one or more cell ranges and allows defining a delimiter.
Usage:
=JOIN(delimiter, range)
or
=JOIN(delimiter, range1, range2, etc)
Usage Example
To obtain a list of references separated by ,
, enter this delimiter and the cell range of references into the JOIN function.
The formula is:
=JOIN(", ",A2:A8)
If you wish to ignore empty cells, use the TEXTJOIN function instead.
Combine and Sort
To display references in alphabetical order, use the SORT function to sort the references before combining them using the JOIN function.
The formula becomes:
=JOIN(", ",SORT(A2:A8))
Combine and Filter
To display references with a quantity greater than 2, use the FILTER function to filter the references before combining them using the JOIN function.
The formula is:
=JOIN(", ",FILTER(A2:A8,B2:B8>2))
And to filter + sort:
=JOIN(", ",SORT(FILTER(A2:A8,B2:B8>2)))