Arguments
delimiter- The separator placed between items, e.g. ", ".ignore_empty- TRUE to skip empty cells, FALSE to keep them.text1- The first text item or range to join.
Joins text from multiple cells or a range with a delimiter, optionally skipping blanks.
Syntax
=TEXTJOIN(delimiter, ignore_empty, text1, [text2], …)delimiter - The separator placed between items, e.g. ", ".ignore_empty - TRUE to skip empty cells, FALSE to keep them.text1 - The first text item or range to join.=TEXTJOIN(", ", TRUE, A2:A10)Returns: A comma-separated list of the non-blank values
Great for turning a column into one cell.
TEXTJOIN is the only join function that puts a separator between items rather than making you type it repeatedly. Its three-part signature - delimiter, ignore_empty, then the things to join - solves the two problems that make & chains painful: a range can be passed as a single argument instead of being spelled out cell by cell, and blank cells can be dropped so the result never contains a run of orphaned commas.
The ignore_empty flag is the argument that decides the shape of the output. With TRUE, empty cells vanish and exactly one delimiter appears between each surviving value; a formula returning "" is dropped the same way, since the empty string counts as empty here. With FALSE, every cell contributes a slot, so a blank produces an empty entry and the delimiters bunch together - which is occasionally what you want, for instance when the result must line up positionally with a fixed set of fields.
TEXTJOIN was added in Excel 2019 and Microsoft 365; it does not exist in Excel 2016 or earlier, where it returns #NAME? and has to be replaced by a & chain or CONCATENATE. Two other limits are worth knowing before you build a report on it. The result is text and is capped at 32,767 characters - the maximum a cell can hold - and exceeding that returns #VALUE! rather than a truncated string. And joined numbers lose their formatting: a cell displaying 1,250.00 or 15/03/2024 arrives as 1250 or 45366, so wrap it in TEXT() when the formatting matters.
| Error | What it means and how to fix it |
|---|---|
| #NAME? | The Excel version predates 2019 and has no TEXTJOIN. Replace it with a & chain, or with CONCATENATE plus manual separators. Opening a 365-made file in Excel 2016 shows _xlfn.TEXTJOIN, which is the same problem. |
| #VALUE! | The joined result exceeds a cell's 32,767-character limit, or one of the joined cells already holds an error. Join fewer rows, or wrap the source values in IFERROR. |
| #REF! | A range in the argument list was deleted. Re-point it; the delimiter and flag arguments are unaffected. |
| #SPILL! or #CALC! | Not from TEXTJOIN itself but from a dynamic array feeding it, typically a FILTER that found nothing. Give FILTER an if_empty argument such as =TEXTJOIN(", ", TRUE, FILTER(A2:A50, B2:B50="Open", "")). |
=TEXTJOIN(CHAR(10), TRUE, B2:B6)Returns: One cell with each value on its own line
CHAR(10) is a line feed. Turn on Wrap Text for the cell or the breaks will not be visible, and use CHAR(13) & CHAR(10) if the text is destined for Windows software outside Excel.
=TEXTJOIN(", ", TRUE, IF(B2:B100="Open", A2:A100, ""))Returns: A comma-separated list of the open items only
The IF returns "" for rows that do not qualify and ignore_empty removes them. In Excel 2019 this needs Ctrl+Shift+Enter; in 365 it does not. FILTER is the cleaner modern equivalent.
=TEXTJOIN(" | ", FALSE, TEXT(A2, "dd mmm"), B2, TEXT(C2, "#,##0.00"))Returns: A formatted one-line summary of a row
ignore_empty is FALSE so an empty middle field still holds its position. TEXT keeps the date and the amount readable, which a bare join would not.
| Application | Support |
|---|---|
| Excel 2007-2016 | Not available. Returns #NAME?; use CONCATENATE or the & operator with typed-out separators. |
| Excel 2019 | Supported, with a fixed argument list. Arrays work but need Ctrl+Shift+Enter in some nested cases. |
| Excel 2021 / Microsoft 365 | Supported, and the natural partner to FILTER, UNIQUE and SORT: =TEXTJOIN(", ", TRUE, UNIQUE(A2:A100)) needs no special entry. |
| Google Sheets | Supported with the same three arguments. Sheets also has JOIN and TEXTJOIN side by side; JOIN takes no ignore_empty flag. |
| LibreOffice Calc | Supported since LibreOffice 5.2. Saved to .xlsx it round-trips as TEXTJOIN, so Excel 2016 opening that file still shows #NAME?. |
Yes. TEXTJOIN uses the same syntax in Google Sheets and LibreOffice Calc, so you can paste these formulas straight across.
The ExcelTool editor implements TEXTJOIN with the standard three-or-more arguments and flattens every text argument, so ranges can be passed directly rather than cell by cell.
The editor requires the delimiter to be a single value: a multi-cell range in that first position returns #VALUE! rather than cycling through several separators as Excel 365 does. The ignore_empty flag is read loosely - TRUE, FALSE, 1, 0 and the text "TRUE" or "FALSE" are all accepted.
With ignore_empty on, both genuinely empty cells and values that are the empty string are skipped, and an error value found anywhere among the joined values is returned as the result of the formula.
The editor does not enforce Excel's 32,767-character cell limit on the joined result, so a very large join that would fail in Excel succeeds here; check the length with LEN before relying on the output in a real workbook.
You can try any of these formulas in the free in-browser spreadsheet editor - it opens .xlsx files, recalculates as you type, and needs no signup.
Fill in your ranges and copy a ready-to-paste formula - no signup.
TEXTJOIN reads the cell's value, not what the cell displays. Dates are stored as serial numbers and the date format lives on the cell, so joining strips it. Wrap the date: =TEXTJOIN(", ", TRUE, TEXT(A2, "dd/mm/yyyy"), B2). The same applies to currency and percentages - 0.15 formatted as 15% joins as 0.15.
Not on its own - ignore_empty only removes blanks. In Excel 365 combine it with UNIQUE: =TEXTJOIN(", ", TRUE, UNIQUE(A2:A100)). In Excel 2019, which has TEXTJOIN but not UNIQUE, remove the duplicates in a helper column first, or use Data > Remove Duplicates on a copy of the column.
The cells are not empty. They almost certainly contain a space, or a formula returning a single space rather than "". A cell holding " " is a value and gets joined. Test with =COUNTBLANK(A2:A20) against =COUNTA(A2:A20), and clean the range with TRIM if the counts disagree with what you see.
The row count is not the constraint; the 32,767-character result is. Excel also caps a formula at 255 arguments, but a whole range counts as one argument, so that limit is hard to reach here. Joining a column of comments will normally break on total length long before anything else.