A Step-by-Step Guide to Using TEXTJOIN in Excel for Combining Cell Values

The TEXTJOIN function is an incredibly useful tool for concatenating or combining text from multiple cells in Excel. In this comprehensive guide, I’ll explain what TEXTJOIN does, when to use it, and walk through a detailed tutorial with examples to demonstrate how to apply it in practice.

After reading you’ll know exactly how to use TEXTJOIN to efficiently merge and output text strings from ranges of cells in your worksheets. Let’s get started!

What is TEXTJOIN?

TEXTJOIN allows you to combine text from multiple cells while inserting a delimiter between each value, Some key things to know

  • Introduced in Excel 2016, replaces Concatenate
  • Merges text from a range of cells into one output
  • Adds a separator or delimiter like a comma between each value
  • Skips blank cells if desired
  • More flexible than Concatenation or & operator

You define the cells to merge, the delimiter to insert between values, and options to skip blanks and control spacing.

TEXTJOIN then assembles one combined string from all the cells, nicely formatted with your specified delimiters in between each item.

When to Use TEXTJOIN

TEXTJOIN shines anytime you need to combine values from many cells. Examples include:

  • Combining first and last names from separate columns into one cell
  • Merging items from a list into a comma-separated list
  • Assembling address parts (street, city, zip) into a single cell
  • Concatenating category and product name into an item description
  • Building a list of tags or keywords from individual cells
  • Formatting multi-value cells for mail merge and other uses

It provides more control over delimiter handling and blank cells than Concatenate. The key is specifying the delimiter so Excel knows how to separate each value.

TEXTJOIN Syntax and Arguments

Here is the syntax structure:

excel

=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)
  • delimiter – Required. The text string to insert between values. Usually a character like comma or space.

  • ignore_empty – Optional. Logical value (TRUE/FALSE) to omit blank cells.

  • text1 – Required. First cell reference or text string to join.

  • [text2] – Optional. Additional cell references or text to include.

Next let’s walk through practical examples to see it in action.

TEXTJOIN Example 1 – Combining First and Last Names

Say you have a dataset of first and last names in separate columns like this:

First Name Last Name
John Smith
Jane Doe
Bob Lee

To combine the first and last name columns with a space delimiter, use this formula:

excel

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

Where A2 and B2 contain the first and last names.

This outputs:

John Smith

It inserts a space between the values and skips blanks with TRUE.

To combine the full name for the entire column, enter this array formula:

excel

=TEXTJOIN(" ",TRUE,A2:A100,B2:B100)

When finished this will build a list of merged names like:

John SmithJane DoeBob Lee

And so on down the column.

TEXTJOIN Example 2 – Comma-Separated List

For another common use case, let’s look at merging a list of items into a comma-separated list.

![Textjoin comma example]

The formula in D2 is:

excel

=TEXTJOIN(", ",TRUE,B2:B6) 

This combine the items in B2 through B6, inserting a comma and space between each cell value.

The result is perfectly formatted as:

apples, oranges, grapes, bananas, blueberries

Use this approach anytime you need a comma-delimited list from a column of items.

TEXTJOIN Example 3 – Concatenating Address

You can also use TEXTJOIN to combine address parts into a full mailing address.

Given columns for street, city, state, and zip like this:

![Textjoin address example]

Use this formula to merge them with commas, spaces and line feeds:

excel

=TEXTJOIN(CHAR(10),TRUE,A2,", ",B2," ",C2,"  ",D2)

CHAR(10) inserts a line break. The end result:

basic

123 Main Street,Anytown, CA 12345

TEXTJOIN makes formatting addresses, names, lists, and other combined values a breeze!

Tips for TEXTJOIN

Here are some additional pointers for mastering TEXTJOIN in Excel:

  • Use CHAR(10) to add line breaks between merged values
  • Nest a TRIM function inside to remove extra spaces
  • Merge numerical and text values together
  • Update the delimiter parameter to customize the separators
  • Reference a cell containing the delimiter text instead of typing it
  • Start the formula with =CONCATENATE( for compatibility with older Excel versions
  • Use IF functions inside TEXTJOIN to only include certain values conditionally

Take a bit of time to experiment with the formula syntax and arguments so you get comfortable combining values in different ways.

Applies to Other Languages

Excel’s TEXTJOIN function works in nearly all languages. The formula remains the same but you simply change the delimiter.

For example, in German use:

excel

=TEXTVERBINDEN(",", WAHR, A2:A100)

In French:

excel

=TEXTE.CONCATÉNER(",", VRAI, A2:A100) 

Most languages support the equivalent of TEXTJOIN. Look for it on the formula tab.

TEXTJOIN provides a powerful, flexible way to combine text cells in Excel. Key takeaways:

  • Merges text from multiple cells into one output
  • Adds custom delimiters between each value
  • Skips blank cells with optional argument
  • Improved version of the Concatenate function

You can now use TEXTJOIN to easily format merged values like names, addresses, lists, tags, and more!

how to use textjoin excel

How to use the TEXTJOIN Function in Excel?

Let’s see a few examples to understand how this function works.

In this example, let’s assume we extracted information from an address and the information is received in the following manner:

Using the formula =TEXTJOIN(“, “,TRUE, B5, C5, D5, E5,F5), we can join the text strings as shown below:

Now let’s assume that we wish to add the text, “Country”, before US. In such a scenario, the formula would change to =TEXTJOIN(” “,TRUE,B6,C6,D6,E6,”Country”,F6).

Using this formula, we will get the result below:

Now suppose we wish to put a space as a delimiter. In such a scenario, the formula to use will be =TEXTJOIN(” “,TRUE,B7, C7, D7, E7,F7).

Let’s see an example of how to join more than two columns (using the data in columns below).

If we use the formula =TEXTJOIN(“, “, TRUE, B4:C12) then Excel will give the following result:

Let’s take an example where we are given the name, surname, and date of anniversary in separate columns and we wish to join them. In this scenario, we need to remember that if we directly enter the date, Excel will return a number, as Excel store dates in number format.

Using the date below:

If for this data we enter the formula =TEXTJOIN( ” “, TRUE, B5:D5,)

Excel will give the result below:

Hence, we need to convert the date into text string first. So, the formula that we need to use would be =TEXTJOIN( ” “, TRUE, B5:D5, TEXT(C2, “mm/dd/yyyy”) ). We get the result below:

  • #VALUE! error – Excel will return this error when the resulting string exceeds the cell limit, which is 32767 characters.
  • The function can handle 252 text arguments.
  • This function is quite similar to the CONCAT function. The difference between the two is that while TEXTJOIN accepts a delimiter, CONCAT doesn’t.
  • #NAME? error – Occurs when you use an older version of Excel that doesn’t support this function.
  • #NULL! error – Occurs when we forget to put the comma between the strings we wish to combine.
  • It gives the user the flexibility to use cell ranges rather than individual cell references.

Thanks for reading CFI’s guide to important Excel functions! By taking the time to learn and master these functions, you’ll significantly speed up your financial analysis. To learn more, check out these additional CFI resources:

  • Share this article

What is the TEXTJOIN Function?

The TEXTJOIN Function[1] joins text from two or more strings together with a delimiter separating each value. Introduced in MS Excel 2016, TEXTJOIN is categorized as an Excel String/Text function.

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

The TEXTJOIN function uses the following arguments:

  • Delimiter (required argument) – The string that is inserted between each text value in the resulting string. The most common delimiters used are a comma or a space character.
  • Ignore_empty (required argument) – This argument helps in determining whether empty cells are included in the resulting string. If the argument is TRUE, it will ignore empty values. If it is FALSE, it will include the empty values in the results.
  • Text1, text2,….text_n – The strings that we wish to join together. The TEXTJOIN function allows us to join up to 252 strings together.

How to use the TEXTJOIN function in Excel

What is textjoin function in Excel?

The TEXTJOIN function combines the content of each cell in the given range. And after each cell’s content, the delimiter (comma) is placed Drag and drop the same to the whole list. Note that for the third address, Cell B4 was empty. Excel didn’t include it in the merged cell content. This is because we had set the ignore_empty argument to TRUE.

What is textjoin in Excel 2019 – Excel 365?

TEXTJOIN is a new function, which is only available in Excel 2019 – Excel 365. In earlier Excel versions, please use the CONCATENATE function or the “&” operator instead. In new versions if Excel, you can also use the CONCAT function to concatenate values from separate cells and ranges, but with no options for delimiters or empty cells.

How do I use textjoin?

Common use cases for the TEXTJOIN function include: Creating easily readable lists from cell ranges. Compiling data from various cells into a single string for reports. Tips for effective use: Use dynamic ranges with TEXTJOIN to automatically update your strings as your data changes.

What is the syntax of the textjoin function?

The syntax of the TEXTJOIN functions is: =TEXTJOIN(delimiter,ignore_empty,text1,) Arguments Explanation The delimiter by which the concatenated texts will be separated. Tells whether to ignore the empty cells in the range or not. The first text string to be joined. The second text string is to be joined.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *