In Excel for Microsoft 365, use TEXTJOIN to combine text from cells with a separator such as a comma, space, or line break, while optionally skipping blank cells. For example, with North, a blank, South, and West in A2:A5, =TEXTJOIN(", ",TRUE,A2:A5) returns North, South, West.
What text joining does in Excel
Text joining means combining several text values into one text string. It is useful for turning separate pieces of information into a readable label, list, address, or sentence. A worksheet might store a person’s first and last names in different columns, or keep product names in separate rows; a joined result can bring the relevant pieces together without manually retyping them.
TEXTJOIN gives you control over two things: the separator inserted between values and whether empty values are ignored. The separator is added between the items Excel joins, not automatically before the first or after the last item. The function can take individual cells, ranges, or a mixture of both. It is available in Microsoft 365 and Excel 2019 or later; the examples here use Microsoft 365 for Windows.
Joining values does not combine the underlying cells or change their contents. It produces a result in the formula cell. If the source values change, Excel recalculates the result. If you need a fixed text result, you can copy the formula cell and use Paste Special > Values.
Build a basic TEXTJOIN formula
The function’s arguments are the delimiter, a TRUE or FALSE choice for ignoring empty values, and the text or cell references to combine. TRUE skips empty values; FALSE keeps their positions in the joined sequence. The following examples show how those choices affect a result.
With the words North in A2, South in A3, and West in A4, =TEXTJOIN(" - ",TRUE,A2:A4) returns North – South – West. The range supplies three values, and the space-hyphen-space delimiter makes the result easy to read.
With Ava in B2, a blank C2, and Patel in D2, =TEXTJOIN(" ",TRUE,B2:D2) returns Ava Patel. Excel skips the blank middle cell and does not leave an extra space for it. This is handy when middle names or apartment details are optional.
For a small number of cells, you can also list references separately. With a street in A2, a city in B2, and a postal code in C2, =TEXTJOIN(", ",TRUE,A2,B2,C2) combines those three cells with comma-space separators. A range is usually more convenient when the values are in consecutive cells; separate references are useful when the cells are apart.
Choose how blank cells are handled
Empty-cell handling is often the difference between a tidy result and a list with gaps. Set the second argument to TRUE when blanks should disappear from the output. This works well for optional fields, incomplete lists, or a range that may grow to include unused rows.
With North in A2, A3 blank, and South in A4, =TEXTJOIN(", ",TRUE,A2:A4) returns North, South. With the same cells and the second argument set to FALSE, =TEXTJOIN(", ",FALSE,A2:A4) returns North, , South. The empty position is retained, so the separators appear on either side of it.
A cell containing a formula that returns an empty string, written as "", is generally treated as empty by TEXTJOIN when ignore_empty is TRUE. A cell containing one or more spaces is different: it has characters in it, even if it looks blank on the sheet. If a result seems to contain a mysterious gap, check the source cells for spaces. You can remove unwanted spaces from source text with TRIM, or clean the source data before joining.
Use separators that fit the result
The delimiter can be any text you want to place between items. Common choices include a comma and space for a readable list, a space for a full name, a slash for a compact label, or a semicolon for values that may already contain commas. If you want the values joined directly, use an empty text delimiter.
With the entries Red, Blue, and Green in A2:A4, =TEXTJOIN(" / ",TRUE,A2:A4) returns Red / Blue / Green. Replacing the delimiter with a comma-space would give a conventional list. Think about where the result will be used: semicolons may be clearer than commas when the items themselves contain comma-separated details.
TEXTJOIN inserts the same delimiter between every pair of included items. It does not add a special word such as “and” before the last item. If you need polished sentence grammar for a variable-length list, you may need additional formulas or a different approach; for short, stable lists, building the wording around the joined result can be simpler.
Join numbers without losing their intended format
Excel stores many numbers as numeric values, and a cell’s display format is not necessarily carried into a text result. That matters for postal codes, ID numbers, dates, and currency. If the exact presentation is important, format the value as text inside the formula before joining it.
With Austin in A2 and the numeric value 1234 in B2, =TEXTJOIN(", ",TRUE,A2,TEXT(B2,"00000")) returns Austin, 01234. The TEXT function applies a five-digit display pattern before TEXTJOIN combines the two parts. This is useful when leading zeroes are meaningful, as they often are in postal codes and identifiers.
For a date, choose a format that suits the audience rather than relying on the workbook’s local display settings. With a date value in A2 and a location in B2, =TEXTJOIN(" - ",TRUE,TEXT(A2,"mmm d, yyyy"),B2) returns a date such as Nov 2, 2026 – Seattle when A2 contains November 2, 2026 and B2 contains Seattle. If the date is stored as text rather than as an Excel date value, TEXT may not interpret it as intended.
Put each joined value on a new line
A line break can be a more readable separator than punctuation when you want one item per line inside a single cell. Excel’s CHAR(10) supplies a line-feed character. After entering the formula, turn on Wrap Text for the result cell so the lines are visible within the cell; adjust the row height if necessary.
With Apples in A2, Pears in A3, and Plums in A4, =TEXTJOIN(CHAR(10),TRUE,A2:A4) joins them as three lines in one cell: Apples, Pears, and Plums, with each word on its own line. The formula does not create three worksheet rows; it creates one text value containing line breaks.
On Windows, you can toggle Wrap Text from Home > Wrap Text. On Mac, the same command is available on the Home tab. The display may differ in Excel for the web, but the formula remains the same. If the result appears on one line, check the cell’s wrapping setting before assuming the formula failed.
Join only values that meet a condition
Sometimes you want a list of names only for rows with a particular status. In Microsoft 365, TEXTJOIN can combine the results of an IF expression, using an empty string for rows that do not meet the condition. This avoids manually filtering and copying matching names for a simple summary.
Suppose A2:A5 contains Nora, Omar, Priya, and Luis, while B2:B5 contains Yes, No, Yes, and Yes. The formula =TEXTJOIN(", ",TRUE,IF(B2:B5="Yes",A2:A5,"")) returns Nora, Priya, Luis. IF passes through each name whose status is Yes and supplies an empty string for Omar; TEXTJOIN then ignores those empty results. In Microsoft 365, enter the formula normally with Enter.
For larger or regularly refreshed reports, consider whether a filtered list on the sheet would be easier to inspect than a single joined cell. A joined string is convenient for display or export, but it is less useful for sorting, counting, or analyzing each matching item separately.
TEXTJOIN compared with CONCAT and the ampersand
Use TEXTJOIN when you need a delimiter across several values or want to skip blanks. CONCAT can combine text and ranges, but it does not provide TEXTJOIN’s delimiter and ignore-empty arguments. The older CONCATENATE function also joins values, but it is less convenient for ranges and is retained mainly for compatibility with older workbooks.
The ampersand operator is a straightforward option for a few fixed pieces. With first name Ava in A2 and surname Patel in B2, =A2&" "&B2 returns Ava Patel. It is easy to read when the number of parts is small, but a long chain of ampersands becomes harder to maintain. For a range of names, TEXTJOIN usually makes the intended separator and blank-cell behavior clearer.
None of these methods changes the source data. Choose based on the shape of the task: ampersand for a couple of known pieces, CONCAT for direct combination, and TEXTJOIN for a delimited list or a range with possible blanks.
Common problems and practical checks
- The formula shows as text. Check that the cell is not formatted as Text, and that the entry begins with an equals sign. Change the number format to General, then re-enter the formula if needed.
- The result has extra separators. Confirm the ignore-empty argument is TRUE and check for cells that contain spaces rather than being truly empty.
- A leading zero disappears. Apply a text format with TEXT, as in the postal-code example, rather than expecting a numeric cell’s display format to carry through.
- The output is too long. Excel cells can contain at most 32,767 characters. A joined result that exceeds the cell-content limit cannot be stored as a normal cell value, so shorten the source list or split it across cells.
- The line breaks are not visible. Use Wrap Text and give the row enough height. The line-break character can be present even when the cell display is not showing separate lines.
- Excel reports a function-name error. Check the spelling and version. TEXTJOIN is available in Microsoft 365 and Excel 2019 or later; older releases may not recognize it.
Before using a joined result in a report or export, check whether separators can also appear inside the source values. A comma-separated string can become ambiguous if an item itself contains commas. In that case, a different delimiter, quoted fields, or keeping the data in separate columns may be safer.
Frequently Asked Questions
Is TEXTJOIN the same as CONCATENATE?
They both combine text, but TEXTJOIN can insert a delimiter between values and can ignore empty cells. CONCATENATE does not offer those options in the same way, so TEXTJOIN is usually more practical for lists and ranges.
Can TEXTJOIN combine cells from different columns?
Yes. You can provide separate cell references or ranges as arguments, including cells that are not next to one another. Decide on the order of those references carefully, because the result follows the order you give Excel.
How do I join cells with a space and skip blanks?
Set the delimiter to a space and the ignore-empty argument to TRUE. For example, with optional name parts in A2:C2, =TEXTJOIN(" ",TRUE,A2:C2) combines the nonblank parts without leaving a gap for an empty cell.
Can TEXTJOIN add a line break between cells?
Yes. Use CHAR(10) as the delimiter, then enable Wrap Text for the result cell. The formula returns one cell containing line breaks, not a separate worksheet row for each item.
Why does TEXTJOIN return an error or an unexpected result?
Check the Excel version, the delimiter, and whether the supposed blanks contain spaces or other characters. Also confirm the joined output is not over Excel’s 32,767-character cell limit, and use TEXT when numbers need a specific appearance such as leading zeroes.
Related
- Excel Not Clicking the Correct Cell? Causes and Fixes
- Excel Copy and Paste Rows Into Columns: 3 Easy Methods
- Excel Not Responding: Should You Wait or Close It?
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- INDIRECT in Excel: How to Drag Formulas to New CellsIf you want an INDIRECT formula to follow different cells as you drag it, build its address from…
- SUMIF Excel Shortcut: The Fastest Way to Use ItExcel has no dedicated keyboard shortcut that inserts a SUMIF formula automatically. The quickest method is to type…
- Filter Excel Table by Text: Steps, Options, and FixesTo filter an Excel table by text in Microsoft 365 for Windows, select the drop-down arrow in the…
- Filter Excel Horizontally: Methods That WorkYes, you can filter Excel horizontally, but the standard Filter dropdown is designed to filter records in rows,…
- Filter an Excel Table by Value: Steps, Tips, and FixesTo filter an Excel table by value in Microsoft Excel for Microsoft 365 on Windows, click the arrow…
- Excel Day of Week from Date: Formulas and FormattingIf your date is in A2, enter =TEXT(A2,"dddd") to show its full weekday name; for example, an actual…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.