FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

TEXTJOIN in Google Sheets

TEXTJOIN accepts arrays in Google Sheets, so you can feed it the result of FILTER, UNIQUE or ARRAYFORMULA directly.

Syntax (same in Google Sheets)

TEXTJOIN(delimiter, ignore_empty, text1, …)

That makes it a short way to build a comma-separated list from a conditional selection.

For a fuller explanation of the arguments and common errors, see the TEXTJOIN Excel guide.

Worked examples in Google Sheets

Comma-separated list

A
1Name
2Ana
3
4Cara
5Dan

Formula: C1: =TEXTJOIN(", ",TRUE,A2:A5)

Result: Ana, Cara, Dan

TRUE skips the empty cell A3, so there are no doubled commas.

Full name

AB
1FirstLast
2MariaLopez

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

Result: Maria Lopez

A single space is the delimiter.

Build a product code

ABC
1RegionProductYear
2EUPen2024

Formula: E2: =TEXTJOIN("-",TRUE,A2:C2)

Result: EU-Pen-2024

Joins a row range with hyphens. A number such as 2024 is joined as is; use TEXT for leading zeros.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in D2: =TEXTJOIN(", ",TRUE,A2:A5)

Example spreadsheet for TEXTJOIN
ABCD
1TextOtherResult
2Alice Johnsonalice johnsonAlice Johnson, [email protected], extra spaces , SKU-2026-0415
3[email protected][email protected]
4 extra spaces
5SKU-2026-0415
6iced coffee, tea, sugar
7Order 417 shipped
Result in D2: Alice Johnson, [email protected], extra spaces , SKU-2026-0415
Practice this in a lesson: Cleaning Data

Frequently asked questions

Can TEXTJOIN join only the rows that meet a condition in Google Sheets?
Yes. Pass FILTER(range, condition) as the text argument and TEXTJOIN joins the surviving values with your delimiter.

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.