TEXTJOIN


Combining text from multiple ranges and/or strings.

Syntax:

TEXTJOIN(delimiter, ignore_empty, textOne, [textTwo], …)


delimiter is required. It is the character or string that will be inserted between each text value in the resulting string. delimiter can be empty ("") to simply concatenate without a delimiter.   

  

ignore_empty is required. It is a logical value (TRUE or FALSE):

TRUE: Ignores empty cells or strings within the specified ranges.   

FALSE: Includes empty cells or strings in the resulting string.   

  

text1, [text2], ... is one or more text strings or cell ranges. You can include up to 252 text arguments.


Example:

If A1:A3 contains Apple, Banana and Carrot:

TEXTJOIN(", ", TRUE, A1:A3)

returns "Apple, Banana, Carrot"



A

B

1
Apple
Apple, Banana, Carrot
2
Banana
 
3
Carrot
 

Application:

Let's imagine you're a teacher and you have a list of students with their test scores in different subjects. You want to create a single cell that summarizes each student's results in a clear, comma-separated list. This is a perfect scenario for using the TEXTJOIN function.


Table:

Student

Math

Science

History

Summary

A
B
C
D
E
1
Alice
95
88
92
95, 88, 92
2
Bob
78
85
80
78, 85, 80
3
Charlie
89
91
87
89, 91, 87

Goal:

In cell E2, you want to combine Bob's scores from cells B2, C2, and D2 into a single, comma-separated string, like "78, 85, 80".


Formula:

In cell E2, you would enter the following formula:

TEXTJOIN(", ", TRUE, B2:D2)


Breakdown of the formula:

  • TEXTJOIN: This is the function name.
  • ", ": This is the delimiter. It's the text you want to place between each item you're joining. In this case, we want a comma followed by a space.
  • TRUE: This is the ignore_empty argument. Setting it to TRUE tells the system to ignore any empty cells within the range you're joining. If there was a blank score, it wouldn't add an extra comma. If you set it to FALSE, it would include the delimiter for the blank cell (e.g., "95, , 92").
  • B2:D2: This is the text1 argument (in this case, a range). It specifies the cells you want to join together.



This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof