Google Sheets TEXTJOIN Function | Join Multiple Values with a Delimiter | Google Sheets Functions

preview_player
Показать описание
Use the Google Sheets TEXTJOIN function to join two or more values, using a single delimiter. A difference between TEXTJOIN and JOIN functions is that with the former, you can choose to ignore empty cells. That is, if there are one or more blank cells in the ranges you have specified, you can tell TEXTJOIN to ignore such cells by setting the ignore_empty attribute to true.

------------------------------
If you wish to join only two values, without a delimiter, you can use
the Google Sheets CONCAT function. Here is the link to the step-by-step video tutorial on CONCAT:

If you wish to join more than two values with a delimiter, a Google Sheets
function you can use is JOIN. Here is the link to the step-by-step video
tutorial on the JOIN function:

------------------------------

Here's the format of the TEXTJOIN function formula:

=TEXTJOIN(delimiter, ignore_empty, text1, [text2, …])

Start the formula with an equal-to symbol.

TEXTJOIN is the name of the function.

delimiter is the string or the address of a cell, which has the string.

ignore_empty ignores blank cells in the specified range of a spreadsheet, if its value is TRUE; this attribute doesn't ignore blank cells, if its value if FALSE.

text1 is the single value, range, or array, in a spreadsheet, to be joined with text2, separated by the delimiter.

text2 is the single value, range, or array that follows immediately after the delimiter.

Let's look at some examples of the TEXTJOIN function formula:

Example 1

=TEXTJOIN(",", TRUE, "Pen", "Paper")

The function will return "Pen,Paper".

Example 2

Say you want to create the fill-in-the-blank question "1 inch=_____cms.", using TEXTJOIN.

Let's make some assumptions: Cell A1 has the text "1 inch=" and B1 has the text "cms.".

The TEXTJOIN function formula:

=TEXTJOIN("_____", TRUE, A1, B1)

will return "1 inch=_____cms."

If you wish to give a space between the end of the line and "cms.", press the spacebar once after the line. Now, the modified output will be:

"1 inch=_____ cms."

Example 3

Assume cells A1 to C1 have the values 1, 2, and 3 respectively, and cells A2 to C2 have the values 4, 5, and 6 respectively in a Google spreadsheet.

The TEXTJOIN function formula:

=TEXTJOIN(",", TRUE, A1:C1, A2:C2)

will return "1,2,3,4,5,6".

If you delete the value in cell A2 in the spreadsheet, what will this TEXTJOIN function return? It will return "1,2,3,5,6".

If you delete the value in cell A2 and use the below TEXTJOIN function formula, what will the function return?

=TEXTJOIN(",", FALSE, A1:C1, A2:C2)

The function will return "1,2,3,,5,6".

Take a look at this video tutorial, which gives the steps to use the Google Sheets TEXTJOIN function with examples.
Рекомендации по теме