How to Use the TEXTJOIN Function in Excel

The TEXTJOIN function in Excel and Google Sheets enables you to concatenate multiple text strings into one. This is particularly useful for aggregating text values from various cells or a range of cells into a single cell.

Basic Syntax

The syntax for the TEXTJOIN function is consistent across both Excel and Google Sheets:

=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)
  • delimiter: The character or string used as a separator between text items.
  • ignore_empty: A boolean value (TRUE or FALSE) that determines whether to exclude empty cells from the concatenation.
  • text1, text2, …: The text items or cell ranges to be concatenated.

Examples

Example 1: Joining Text Strings

Consider the scenario where text values reside in cells A1, A2, and A3 in Excel:

A B
Apple =TEXTJOIN(“, “, TRUE, A1, A2, A3)
Orange
Banana

The formula =TEXTJOIN(", ", TRUE, A1, A2, A3) concatenates the values from cells A1, A2, and A3 using a comma and a space as the delimiter. This will output “Apple, Orange, Banana” into cell B1.

Example 2: Joining Text Strings with Ignore Empty Cells

If you prefer to exclude empty cells while concatenating text, set the ignore_empty argument to TRUE. Consider this example:

A B
Apple =TEXTJOIN(“, “, TRUE, A1, “”, A3)
Banana

In this scenario, the formula =TEXTJOIN(", ", TRUE, A1, "", A3) considers only the non-empty cells (A1 and A3), resulting in “Apple, Banana” displayed in cell B1.

Example 3: Joining Text Strings from a Range

The TEXTJOIN function can also concatenate text values across a cell range. For example, to join text values in cells A1 to A5, separated by a line break, you can use:

A B
Apple =TEXTJOIN(CHAR(10), TRUE, A1:A5)
Orange
Banana
Peach

The formula =TEXTJOIN(CHAR(10), TRUE, A1:A5) concatenates the values from A1 to A5, using a line break as the delimiter, resulting in the respective values appearing in cell B1 separated by line breaks.

These examples showcase the flexibility and utility of the TEXTJOIN function in Excel and Google Sheets for merging text strings in a variety of contexts based on specific needs.

More information: https://support.microsoft.com/en-us/office/textjoin-function-357b449a-ec91-49d0-80c3-0e8fc845691c

Other functions
Returns an array of text values from any specified range
Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters
Converts a number to text, using the ß (baht) currency format
Returns the character specified by the code number
Removes all nonprintable characters from text
Returns a numeric code for the first character in a text string
Combines the text from multiple ranges and/or strings, but it doesn't provide the delimiter or IgnoreEmpty arguments
Joins several text items into one text item
Changes half-width (single-byte) English letters or katakana within a character string to full-width (double-byte) characters
Converts a number to text, using the $ (dollar) currency format
Checks to see if two text values are identical
Finds one text value within another (case-sensitive)
Formats a number as text with a fixed number of decimals
Changes half-width (single-byte) characters within a string to full-width (double-byte) characters
Returns the leftmost characters from a text value
Returns the number of characters in a text string
Converts text to lowercase
Returns a specific number of characters from a text string starting at the position you specify
Converts text to number in a locale-independent manner
Extracts the phonetic (furigana) characters from a text string
Capitalizes the first letter in each word of a text value
Replaces characters within text
Repeats text a given number of times
Returns the rightmost characters from a text value
Finds one text value within another (not case-sensitive)
Substitutes new text for old text in a text string
Converts its arguments to text
Formats a number and converts it to text
Removes spaces from text
Returns the Unicode character that is references by the given numeric value
Returns the number (code point) that corresponds to the first character of the text
Converts text to uppercase
Converts a text argument to a number
Returns text from any specified value