The Excel TEXTJOIN function concatenates (joins) values with a given delimiter. Unlike the CONCAT function, TEXTJOIN allows you to supply a range of cells, and has a setting to ignore empty values.
Syntax:= TEXTJOIN (delimiter, ignore_empty, text1, [text2], …)
The TEXTJOIN function syntax has 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.
Example: Let’s look at some Excel TEXTJOIN function examples and explore how to use the TEXTJOIN function as a worksheet function in Microsoft Excel:
Based on the Excel spreadsheet above, the following TEXTJOIN examples would return:
- #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.