Have you ever wanted to combine text from multiple cells into one cell?
For example, you may have first names in one column and last names in another. Or you may have a list of products that you want to combine with commas between them.
You can do this using Excel text functions such as CONCATENATE, CONCAT, and TEXTJOIN.
The TEXTJOIN function makes this task easier. It combines text from multiple cells and automatically adds a separator, such as a comma, space, or hyphen, between the values.
You can also use it to skip empty cells while joining text.
Let’s see how to use the TEXTJOIN function in Excel with simple examples.
What Is the TEXTJOIN Function in Excel?
The TEXTJOIN function combines text from multiple cells into a single cell using a separator of your choice.
A separator, also called a delimiter, is a character or symbol placed between the joined values.
For example, you can use:
- A space to combine first and last names.
- A comma to separate product names.
- A hyphen to combine product codes.
- A line break to display each value on a new line.
You can also tell Excel to ignore empty cells while combining text.
TEXTJOIN Function Syntax:
The syntax of the TEXTJOIN function is:
=TEXTJOIN(delimiter, ignore_empty, text1, [text2], …)
Let’s understand each argument:
| Argument | Description |
| delimiter | The character or symbol to place between the text values. |
| ignore_empty | TRUE to ignore empty cells or FALSE to include them. |
| text1 | The first text value, cell reference, or range to join. |
| [text2] | Additional text values, cell references, or ranges. This is optional. |
Note: You can use a single cell, multiple cells, or an entire range in the TEXTJOIN function.
How to Use the TEXTJOIN Function in Excel?
Let’s look at some simple examples to understand how this function works.
Example 1: Join First Name and Last Name with a Space
Suppose you have first names in column A and last names in column B.
| First Name | Last Name |
| Ravi | Kumar |
| Priya | Sharma |
| Suresh | Reddy |
| Anil | Verma |
You want to combine the first and last names into a single cell.
Steps:
1. Select cell C2.
2. Enter this formula:
=TEXTJOIN(” “,TRUE,A2,B2)
3. Press Enter.
4. Drag the formula down to apply it to the remaining rows.
Result:

Here, ” ” adds a space between the first and last names.
Example 2: Join Multiple Cells with Commas
Suppose you have a list of products in cells A2 to A6.
| Product |
| Laptop |
| Mouse |
| Keyboard |
| Monitor |
| Printer |
You want to combine all the product names into one cell, with a comma between each name.
Enter this formula:
=TEXTJOIN(“, “,TRUE,A2:A6)
Result:
Laptop, Mouse, Keyboard, Monitor, Printer

Here:
- “, ” adds a comma and a space between the product names.
- TRUE tells Excel to ignore empty cells.
- A2:A6 is the range containing the product names.
You can change the comma to another separator whenever needed.
Example 3: Join Cells with a Hyphen
Suppose you have product details in three separate columns.
| Product | Category | Code |
| Laptop | Dell | 101 |
| Mouse | HP | 102 |
| Keyboard | Lenovo | 103 |
You want to combine these details using a hyphen.
Enter this formula in cell D2:
=TEXTJOIN(“-“,TRUE,A2:C2)
Result:

Drag the formula down to combine the details for the remaining products.
Example 4: Ignore Empty Cells Using TEXTJOIN
One useful feature of TEXTJOIN is that it can skip empty cells.
Suppose you have the following data:
| A | B | C | D |
| Apple | Banana | Orange |
You want to combine these values using commas.
Enter this formula:
=TEXTJOIN(“, “,TRUE,A2:D2)
Result:
Apple, Banana, Orange

Excel skips the empty cell and joins only the available values.
Now, change TRUE to FALSE:
=TEXTJOIN(“, “,FALSE,A2:D2)
Result:
Apple, Banana, , Orange

When you use FALSE, Excel includes empty cells. This can leave extra separators in the result.
Tip: Use TRUE when you want to combine values without extra commas or separators caused by blank cells.
Example 5: Join Text with a Line Break
Sometimes, you may want each value to appear on a separate line within the same cell.
For example, you have a list of tasks in different cells and want to combine them into one cell.
You can use the CHAR(10) function to add a line break between the values.
Enter this formula:
=TEXTJOIN(CHAR(10),TRUE,A2:A5)
Here, CHAR(10) adds a line break between each value.

Important: After entering the formula, select the result cell and click Wrap Text on the Home tab. This allows Excel to display each value on a separate line.
Difference Between CONCATENATE, CONCAT, and TEXTJOIN:
Excel has three commonly used functions for combining text: CONCATENATE, CONCAT, and TEXTJOIN.
However, they work in slightly different ways.
| Function | Description |
| CONCATENATE | Combines text from different cells or values. |
| CONCAT | Combines text from multiple cells or ranges. |
| TEXTJOIN | Combines text using a separator and can ignore empty cells. |
For example, suppose you want to combine cells A2, B2, and C2 with commas between them.
Using CONCATENATE:
=CONCATENATE(A2,”, “,B2,”, “,C2)
Using CONCAT:
=CONCAT(A2,”, “,B2,”, “,C2)
Using TEXTJOIN:
=TEXTJOIN(“, “,TRUE,A2:C2)
As you can see, TEXTJOIN makes it easier to add the same separator between multiple cells. You can also choose whether to ignore empty cells.
Important Things to Know About TEXTJOIN:
- TEXTJOIN is available in Excel 2019 and later versions, including Microsoft 365.
- You can use commas, spaces, hyphens, or other characters as separators.
- Use TRUE to ignore empty cells and FALSE to include them.
- You can combine individual cells, ranges, or both.
- If the combined result exceeds Excel’s 32,767-character cell limit, Excel returns a VALUE! error.
Frequently Asked Questions:
1. What is the TEXTJOIN function used for in Excel?
The TEXTJOIN function combines text from multiple cells into one cell. You can add separators such as commas, spaces, or hyphens between the values.
2. What is the difference between TRUE and FALSE in TEXTJOIN?
TRUE tells Excel to skip empty cells while joining text. FALSE includes empty cells, which may result in extra separators.
3. Can I use TEXTJOIN to combine an entire range?
Yes. You can use a cell range directly in the formula.
For example:
=TEXTJOIN(“, “,TRUE,A2:A10)
This combines all non-empty cells in the range A2:A10, with commas between the values.
4. Can TEXTJOIN add a line break between values?
Yes. Use CHAR(10) as the separator.
=TEXTJOIN(CHAR(10),TRUE,A2:A5)
Remember to turn on Wrap Text to display the values on separate lines.
5. What is the difference between CONCAT and TEXTJOIN?
CONCAT combines text from multiple cells or ranges without automatically adding a separator. TEXTJOIN lets you choose a separator and ignore empty cells.
Final Thoughts:
The TEXTJOIN function makes it easy to combine text from multiple cells with commas, spaces, hyphens, or other separators.
You don’t need to add the separator between every cell manually. Just enter it once in the formula.
It is especially useful when working with names, product details, addresses, and lists that contain empty cells.
Discover more from Excellopedia
Subscribe to get the latest posts sent to your email.
