Excellency

View Original

The TEXTJOIN function

The TEXTJOIN function is a text function which allows you to join multiple strings together, separating all strings by a set delimiter. You can set the function to ignore blank results, or to include them, as per the needs of your situation.

This is the format of the TEXTJOIN function:

=TEXTJOIN( DELIMITER, IGNORE FALSE, TEXT 1, TEXT 2, etc…)

Here is an example of the TEXTJOIN function:

=TEXTJOIN( “, ”, TRUE, “apple”,”banana”,”candy”) = apple, banana, candy

TEXTJOIN function merging all non-blank cells into one field, and separating each of them with a comma

This function is valuable when you have multiple results which get returned from a request, and you want to list the results in a single cell with some form of good order. Pairing this with something like a complex IF statement to return only the intended results saves a lot of future manipulations.

An example of a functional implementation of this would be when you have multiple colours available in the same product and would like to list them all in one cell. In a table you have the product code in the leftmost column and in the subsequent columns you have each colour the product comes in. You want them all in once cell to take up less space and be more presentable. There are never more than four colours per product.

Ex: Product code is in cell A2, colours are in cells B2:E2

=TEXTJOIN(“, “, TRUE, B2:E2)