Skip to Content

How to Use the TEXTJOIN Function in Google Sheets

If you want to combine text together from different strings in Google Sheets with a specific separator, the TEXTJOIN function will come in handy.

In this tutorial, I will show you how to use the TEXTJOIN function in Google Sheets.

TEXTJOIN Syntax

TEXTJOIN is a function that will combine together text from multiple strings and/or arrays using a delimiter that you specify in the arguments of the function to separate the text.

Essentially the function concatenates with a separator.

The syntax of the function is:

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

  • delimiter – this argument represents that character or string that you want to be placed between each text. Most common you will be using either a space or a comma here
  • ignore_empty – this argument will be set to either TRUE or FALSE. This controls whether empty cells in the arguments will be used in the result. TRUE will ignore empty values while FALSE will include them
  • text1 – this is the first text item that you want to be joined together. It could be a string or an array of strings
  • text2 – this is an optional argument. You can add additional text items here if desired

Using TEXTJOIN

Now let’s take a look at how to actually use the TEXTJOIN function by taking a look at a few examples.

TEXTJOIN example

In the example above, I have the TEXTJOIN function entered three different times, each one has different parameters so the result is slightly different on each one.

Let’s breakdown what each of them is doing:

  • =TEXTJOIN(” “,TRUE,A2:A6) – this one is joining the text in range A2:A6 together with a space in between and ignoring empty cells.
    • The first argument is set to a space (” “), so that is what joins the text
    • The second argument (TRUE) tells the function to ignore empty cells and not include them in my final result
  • =TEXTJOIN(” “,FALSE,A2:A6) – this one is joining the text in range A2:A6 together with a space in between and including empty cells
    • The first argument is set to a space (” “), so that is what joins the text
    • The second argument (FALSE) tells the function to include empty cells so they are included in the final result
  • =TEXTJOIN(“,”,TRUE,A2:A6) – this one is joining the text in range A2:A6 together with a comma in between and ignoring empty cells
    • The first argument is set to a comma (” ,”), so that is what joins the text
    • The second argument (TRUE) tells the function to ignore empty cells and not include them in my final result

Closing Thoughts

If you need to join text together from a range with a specific separator, the TEXTJOIN function is a very efficient way to do this.

This function works with a number of other formulas in Google Sheets that can be used together to do some powerful things when you get creative with it.

I have only shown the basics of the function in this post, but even by itself, this one has its uses.

Related Posts:
How to Combine Two Cells into One
How to Use the RIGHT Function