How to Use the TEXTJOIN Function in Google Sheets to Combine Cells

Combining text from multiple cells in Google Sheets has historically been a tedious process. For years, users relied on the CONCATENATE function or the ampersand (&) operator. While effective for joining two or three cells, these older methods become incredibly messy when dealing with large lists, as you have to manually type commas or spaces between every single cell reference.

To solve this, Google Sheets introduced the TEXTJOIN function. TEXTJOIN is vastly superior to CONCATENATE because it allows you to specify a delimiter (like a comma) exactly once, and it can automatically ignore empty cells.

In this guide, you will learn how to use the TEXTJOIN function to cleanly merge data across multiple rows and columns.

The TEXTJOIN Syntax

The TEXTJOIN function requires three specific arguments to operate:

=TEXTJOIN(delimiter, ignore_empty, text1, [text2, ...])
  • delimiter: The character(s) you want to insert between each piece of joined text (e.g., a comma, a space, a hyphen). This must be enclosed in double quotation marks.
  • ignore_empty: A TRUE or FALSE statement. If TRUE, the formula will skip any blank cells in your range, preventing awkward double-commas.
  • text1: The range of cells you want to combine.

Use Case 1: Combining First and Last Names

Imagine you have a list of employees. First names are in Column A, and last names are in Column B. You want to combine them into a “Full Name” in Column C, separated by a single space.

Click into cell C2 and type:

=TEXTJOIN(" ", TRUE, A2:B2)

Let’s break down the logic:

  1. " " sets the delimiter as a single space.
  2. TRUE tells Google Sheets to ignore the cell if one of the names is missing.
  3. A2:B2 is the range containing the two names.

The formula instantly joins the names with a perfect space in between.

Use Case 2: Creating a Comma-Separated Email List

This is where TEXTJOIN truly outshines older methods. Suppose you have a vertical list of 50 client email addresses from cell A2 down to A51. You need to paste all of these emails into the “Bcc” field of an email client, meaning they must be separated by a comma and a space.

Using the old CONCATENATE method, you would have to click on all 50 cells individually. With TEXTJOIN, it requires a single, elegant formula:

=TEXTJOIN(", ", TRUE, A2:A51)

This formula scans all 50 rows. It ignores any blank rows (because of the TRUE statement), and outputs a massive, perfectly formatted string of 50 email addresses separated by commas, ready to be copied and pasted.

Use Case 3: Advanced Delimiters (Line Breaks)

Delimiters do not have to be standard punctuation marks. You can use TEXTJOIN to combine multiple columns of address data (Street, City, Postcode) into a single cell, but formatted exactly like a standard mailing label with line breaks.

To create a line break inside a Google Sheets formula, you must use the CHAR(10) function, which represents a carriage return.

=TEXTJOIN(CHAR(10), TRUE, A2:C2)

This formula will take the Street (A2), City (B2), and Postcode (C2), and stack them neatly on top of each other within a single cell.

By replacing outdated concatenation methods with the TEXTJOIN function, you can process and format massive datasets with significantly less effort and a vastly reduced risk of syntax errors.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.