Going Stellar

Home/Google Sheets reference

Google Sheets function · Text

TEXTJOIN in Google Sheets: syntax and examples

TEXTJOIN glues texts and ranges into one string, with a delimiter between the pieces. Unlike CONCATENATE, it takes whole ranges and can leave empty cells out.

Syntax

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

Arguments

ArgumentTypeRequiredWhat it does
delimitertextyesThe text placed between the pieces, such as ", " or " - ". It can be empty.
ignore_emptybooleanyesTRUE skips empty cells. FALSE keeps them, which leaves doubled delimiters.
text1anyyesThe first text, cell or range to join. Ranges are read row by row.
text2anynoMore texts, cells or ranges to append.

Examples

The examples use this table, starting in A1:

ItemColorSizeNote
LampblackLED
ChairgreyL
StandsilverMAlu
=TEXTJOIN(", ", TRUE, A2:D2)

Result: Lamp, black, LED

Joins a whole row. The empty size cell is skipped, so there is no double comma.

Run in a Google Sheet (English US locale) on .

=TEXTJOIN(", ", FALSE, A2:D2)

Result: Lamp, black, , LED

The same row with ignore_empty set to FALSE: the empty cell leaves a gap between two delimiters.

Run in a Google Sheet (English US locale) on .

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

Result: Lamp - black

Two single cells with a custom delimiter.

Run in a Google Sheet (English US locale) on .

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

Result: Lamp, Chair, Stand

A column of items turned into one comma list.

Run in a Google Sheet (English US locale) on .

=TEXTJOIN(", ", TRUE, ARRAYFORMULA(UPPER(A2:A4)))

Result: LAMP, CHAIR, STAND

A function applied to every cell first, then joined. ARRAYFORMULA makes UPPER work on the whole range.

Run in a Google Sheet (English US locale) on .

Common errors

  • The second argument is required. Writing only a delimiter and a range returns #N/A.
  • ignore_empty must be TRUE or FALSE. A text such as "yes" returns #VALUE!.
  • With FALSE, every empty cell still adds a delimiter, so you get "Lamp, black, , LED". Use TRUE for clean lists.
  • A range is read row by row, left to right. For a column the order is top to bottom.

Compared with Excel

Same syntax as Excel TEXTJOIN. Excel 2019 and later have it, older versions do not.

Sources

  1. TEXTJOIN (Docs Editors Help)

Markdown version · All functions