Concatenating Strings in Excel: Using CONCAT and TEXTJOIN Functions

スポンサーリンク
スポンサーリンク

How to Concatenate Strings

This article explains how to concatenate strings in Excel. It is especially useful for combining text from multiple cells into one. We will focus on using the CONCAT and TEXTJOIN functions.

Using the CONCAT Function to Concatenate Strings

A B C D
1 First Name Last Name Full Name
2 John Smith =CONCAT(B2, ” “, A2)
3 Jane Doe =CONCAT(B3, ” “, A3)

Steps

  1. First, enter the first names in column A and the last names in column B.
  2. Use the CONCAT function in column C to combine the first and last names.
  3. For example, in cell C2, enter:
    =CONCAT(B2, ” “, A2) to combine the last name and first name with a space in between.

Function Explanation

The CONCAT function combines text from multiple cells into one. In this example, it merges the last and first names into a single string.

Result

For example, if A2 contains “John” and B2 contains “Smith”, cell C2 will display “Smith John”.

Using the TEXTJOIN Function to Concatenate Strings

A B C D
1 First Name Last Name Full Name
2 John Smith =TEXTJOIN(” “, TRUE, B2, A2)
3 Jane Doe =TEXTJOIN(” “, TRUE, B3, A3)

Steps

  1. First, enter the first names in column A and the last names in column B.
  2. Use the TEXTJOIN function in column C to concatenate the text with a delimiter.
  3. For example, in cell C2, enter:
    =TEXTJOIN(” “, TRUE, B2, A2) to concatenate the last name and first name with a space as the delimiter.

Function Explanation

The TEXTJOIN function concatenates multiple cells’ content using a specified delimiter. It also allows ignoring empty cells.

Result

For example, if A2 contains “John” and B2 contains “Smith”, cell C2 will display “Smith John”.

Summary

To concatenate strings, the CONCAT function is suitable for straightforward combinations, while the TEXTJOIN function is excellent for merging multiple cells with a delimiter. Choose the function that best suits your needs.

Note on String Length

Keep in mind that directly entering strings into the function has a 255-character limit. If your text exceeds this limit, split it into smaller parts using “, “ within the function.