search
HomeTopicsexcelTEXTJOIN function in Excel to merge text from multiple cells

This tutorial demonstrates the Excel TEXTJOIN function's power in merging text strings, offering a flexible alternative to concatenation. It surpasses older methods by allowing customizable delimiters and handling of empty cells.

  • Excel's TEXTJOIN Function
  • Formula Examples: Joining Text in Excel
    • Concatenating Lists with Commas
    • Using Different Delimiters
    • Combining Text and Dates
    • Merging Text with Line Breaks
    • Conditional TEXTJOIN
    • TEXTJOIN with Multiple Criteria
    • Returning Multiple Lookup Matches as a Comma-Separated List
  • Troubleshooting TEXTJOIN Errors

Understanding the TEXTJOIN Function

TEXTJOIN efficiently combines text strings from cells or ranges, inserting a specified delimiter between each value. It offers control over whether empty cells are included. This function is available in Excel 365, Excel 2021, and Excel 2019.

Syntax:

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

  • Delimiter: (Required) The separator between combined values (e.g., ", ", ";", CHAR(10) for line breaks).
  • Ignore_empty: (Required) TRUE to ignore blank cells; FALSE to include them.
  • Text1: (Required) The first text value or cell range.
  • Text2, ...: (Optional) Additional text values or ranges (up to 252).

Example: Combining Address Parts

Instead of: =CONCATENATE(A2, ", ", B2, ", ", C2)

Use: =TEXTJOIN(", ", TRUE, A2:C2)

This simplifies merging multiple cells.

TEXTJOIN function in Excel to merge text from multiple cells

Key Considerations for TEXTJOIN:

  1. Excel Version: Only available in Excel 2019 and later. Use CONCATENATE or "&" in older versions.
  2. CONCAT Function: Excel's CONCAT function offers simpler concatenation but lacks delimiter and empty cell handling options.
  3. Number Handling: Numbers supplied as arguments are treated as text.
  4. Empty Delimiter: An empty string ("") as a delimiter concatenates values without separators.
  5. Argument Limit: Supports up to 252 text arguments.
  6. Character Limit: The result is limited to 32,767 characters; exceeding this causes a #VALUE! error.

Practical Formula Examples

1. Creating Comma-Separated Lists:

Concatenate a vertical list (e.g., wins/losses): =TEXTJOIN(",", FALSE, B2:B6) (FALSE includes empty cells).

TEXTJOIN function in Excel to merge text from multiple cells

2. Using Multiple Delimiters:

Use an array constant or cell references for varying delimiters:

=TEXTJOIN({", "," "}, TRUE, A2:C2) (array constant)

or

=TEXTJOIN($F$3:$G$3, TRUE, A2:C2) (cell references)

TEXTJOIN function in Excel to merge text from multiple cells

3. Combining Text and Dates:

Convert dates to text using TEXT: =TEXTJOIN(" ", TRUE, A2, TEXT(B2, "mm/dd/yyyy"))

TEXTJOIN function in Excel to merge text from multiple cells

4. Adding Line Breaks:

Use CHAR(10): =TEXTJOIN(CHAR(10), TRUE, A2:B2) (Remember to enable "Wrap Text").

TEXTJOIN function in Excel to merge text from multiple cells

5. Conditional TEXTJOIN:

Combine IF for conditional merging: =TEXTJOIN(", ", TRUE, IF($B$2:$B$9=1, $A$2:$A$9, "")) (Array formula in Excel 2019).

TEXTJOIN function in Excel to merge text from multiple cells

6. TEXTJOIN with Multiple Criteria:

Use * as AND operator within nested IFs: =TEXTJOIN(", ", TRUE, IF(($A$2:$A$24=E2)*($B$2:$B$24=F2), $C$2:$C$24, "")) (Array formula in Excel 2019).

TEXTJOIN function in Excel to merge text from multiple cells

7. Multiple Lookup Matches:

Return all matches as a comma-separated list: =TEXTJOIN(", ", TRUE, IF($A$2:$A$12=D2, $B$2:$B$12, "")) (Array formula in Excel 2019).

TEXTJOIN function in Excel to merge text from multiple cells

Troubleshooting Errors:

  • #NAME?: Function not supported in the Excel version or misspelled.
  • #VALUE?: Result exceeds 32,767 characters or an invalid delimiter is used.

This comprehensive guide empowers you to harness the full potential of Excel's TEXTJOIN function for efficient text manipulation.

The above is the detailed content of TEXTJOIN function in Excel to merge text from multiple cells. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to create timeline in Excel to filter pivot tables and chartsHow to create timeline in Excel to filter pivot tables and chartsMar 22, 2025 am 11:20 AM

This article will guide you through the process of creating a timeline for Excel pivot tables and charts and demonstrate how you can use it to interact with your data in a dynamic and engaging way. You've got your data organized in a pivo

Can excel import xml filesCan excel import xml filesMar 07, 2025 pm 02:43 PM

Excel can import XML data using its built-in "From XML Data Import" function. Import success depends heavily on XML structure; well-structured files import easily, while complex ones may require manual mapping. Best practices include XML

how to do a drop down in excelhow to do a drop down in excelMar 12, 2025 am 11:53 AM

This article explains how to create drop-down lists in Excel using data validation, including single and dependent lists. It details the process, offers solutions for common scenarios, and discusses limitations such as data entry restrictions and pe

how to sum a column in excelhow to sum a column in excelMar 14, 2025 pm 02:42 PM

The article discusses methods to sum columns in Excel using the SUM function, AutoSum feature, and how to sum specific cells.

how to make pie chart in excelhow to make pie chart in excelMar 14, 2025 pm 03:32 PM

The article details steps to create and customize pie charts in Excel, focusing on data preparation, chart insertion, and personalization options for enhanced visual analysis.

how to calculate mean in excelhow to calculate mean in excelMar 14, 2025 pm 03:33 PM

Article discusses calculating mean in Excel using AVERAGE function. Main issue is how to efficiently use this function for different data sets.(158 characters)

how to make a table in excelhow to make a table in excelMar 14, 2025 pm 02:53 PM

Article discusses creating, formatting, and customizing tables in Excel, and using functions like SUM, AVERAGE, and PivotTables for data analysis.

how to add drop down in excelhow to add drop down in excelMar 14, 2025 pm 02:51 PM

Article discusses creating, editing, and removing drop-down lists in Excel using data validation. Main issue: how to manage drop-down lists effectively.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use