TEXTJOIN function

This article describes the formula syntax and usage of TEXTJOIN, one of the text functions in Microsoft Excel.

Important: This function is available if you are an Office 365 subscriber and have the latest version of Office installed. It's also available with Excel Online, Excel Mobile, Excel for iOS, and Excel for Android phones and tablets.

Description

The TEXTJOIN function combines the text from multiple ranges and/or strings, and includes a delimiter you specify between each text value that will be combined. If the delimiter is an empty text string, this function will effectively concatenate the ranges.

Syntax

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

argument

Description

delimiter
(required)

A text string, either empty, or one or more characters enclosed by double quotes, or a reference to a valid text string. If a number is supplied, it will be treated as text.

ignore_empty
(required)

If TRUE, ignores empty cells.

text1
(required)

Text item to be joined. A text string, or array of strings, such as a range of cells.

[text2, ...]
(optional)

Additional text items to be joined. There can be a maximum of 252 text arguments for the text items, including text1. Each can be a text string, or array of strings, such as a range of cells.

For example, =TEXTJOIN(" ",TRUE, "The", "sun", "will", "come", "up", "tomorrow.") will return The sun will come up tomorrow.

Remarks

  • If the resulting string exceeds 32767 characters (cell limit), TEXTJOIN returns the #VALUE! error.

Examples

Copy the example data in each of the following tables, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Example 1

Currency

US Dollar

Australian Dollar

Chinese Yuan

Hong Kong Dollar

Israeli Shekel

South Korean Won

Russian Ruble

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

Result: US Dollar, Australian Dollar, Chinese Yuan, Hong Kong Dollar, Israeli Shekel, South Korean Won, Russian Ruble

Example 2

A's

B's

a1

b1

a2

b2

a4

b4

a5

b5

a6

b6

a7

b7

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

Result: a1, b1, a2, b2, a4, b4, a5, b5, a6, b6, a7, b7

If ignore_empty=FALSE, the result would be: a1, b1, a2, b2, , , a4, b4, a5, b5, a6, b6, a7, b7

Example 3

City

State

Postcode

Country

Tulsa

OK

74133

US

Seattle

WA

98109

US

Iselin

NJ

08830

US

Fort Lauderdale

FL

33309

US

Tempe

AZ

85285

US

end

,

,

,

;

=TEXTJOIN(A9:D9, TRUE, A2:D7)

Result: Tulsa,OK,74133,US;Seattle,WA,98109,US;Iselin,NJ,08830,US;Fort Lauderdale,FL,33309,US;Tempe,AZ,85285,US

Do you have a specific function question?

Post a question in the Excel community forum

Help us improve Excel

Do you have suggestions about how we can improve the next version of Excel? If so, please check out the topics at Excel User Voice

See Also

CONCATENATE function

CONCAT function

Overview of formulas in Excel

How to avoid broken formulas

Find and correct errors in formulas

Excel keyboard shortcuts and function keys

Text functions (reference)

Excel functions (alphabetical)

Excel functions (by category)

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×