Yes. In Microsoft 365, use TEXTJOIN to combine text from several cells into one, with a separator and an option to skip blanks. With Red in A2, a blank A3, Blue in A4, and Green in A5, =TEXTJOIN(", ",TRUE,A2:A5) returns Red, Blue, Green.
How TEXTJOIN combines cells
TEXTJOIN is usually the most convenient way to consolidate text because you choose what goes between each item. Its arguments are the delimiter, whether to ignore empty cells, and the text or range to combine. The delimiter is repeated between included values, not added at the beginning or end. In the opening example, the comma and space appear between the three nonblank entries.
The second argument, TRUE, tells Excel to skip empty cells. Change it to FALSE if you want Excel to preserve empty positions in the sequence. For example, when the cells contain Red, blank, and Blue, a comma-and-space delimiter with empty cells preserved can leave two separators together. That may be useful when blanks represent missing fields, but it often looks untidy in a list.
TEXTJOIN is available in Microsoft 365 and newer perpetual Excel versions, including Excel 2019, 2021, and 2024. It also works in Excel for the web. If you are using an older Excel release that does not recognize it, use the ampersand method described below.
Combine text with a separator
To join two cells, use the ampersand operator, &, and put the separator inside quotation marks. This approach works in a wide range of Excel versions and is easy to adapt for a small number of cells.
With a first name in A2 and a last name in B2, =A2&" "&B2 returns Dana Lee. The quoted space is literal text inserted between the cell values. To join without a gap, leave out that quoted space; to add a comma, use a quoted comma and space instead.
For a longer list, you can chain more cell references, but the formula becomes harder to read and maintain. If the list grows or contains blanks, TEXTJOIN is generally clearer. A formula that explicitly connects three cells can also leave stray separators when one of those cells is empty, whereas TEXTJOIN can skip empty entries for you.
Build the formula step by step
For a column of names or labels, follow these steps in Excel for Microsoft 365 on Windows:
- Choose an empty cell for the combined result, such as B2. Do not put the result inside the source range.
- Type
=TEXTJOIN(", ",TRUE,A2:A10)if the items are in A2:A10 and you want commas followed by spaces between nonblank entries. - Press Enter. Excel displays the combined text in the result cell.
- If the source list will change, leave the formula in place. It recalculates when a referenced value changes.
In this example, assume A2:A10 contains the names Ava, Ben, and Kai in A2, A3, and A4, with the remaining cells blank. The formula returns Ava, Ben, Kai. Excel treats the range as a sequence from its first cell to its last, so the result follows the order of the cells. Sort the source range first if you need a different order.
Excel for Mac and Excel for the web support the same formula. Depending on regional settings, Excel may expect semicolons rather than commas as argument separators; use the separator your installation accepts. The formulas here use standard English-language Excel syntax with commas.
Choose a delimiter that suits the data
A delimiter makes the combined result readable and can also help separate fields for another purpose. Common choices include a comma and space for names, a semicolon for phrases that already contain commas, a slash for alternatives, or a vertical bar for compact data. Avoid using a delimiter that appears frequently inside the values unless readers can still tell where one item ends and the next begins.
With A2:A5 containing North, South, East, and West, =TEXTJOIN(" - ",TRUE,A2:A5) returns North - South - East - West. Change the first argument to the separator you want; the rest of the formula can stay the same. A delimiter can be more than one character, so you can use a phrase or punctuation plus spacing.
If the output needs to be pasted into another system, check that system’s expected format before choosing punctuation. Commas, for instance, can be meaningful inside CSV-style data. A separator that is visually clear in a worksheet is not automatically a safe separator for importing or exporting data.
Put each item on a new line
A single cell can contain line breaks as well as ordinary text. This is useful for addresses, notes, or a compact list that should remain in one cell. With entries in A2:A5, =TEXTJOIN(CHAR(10),TRUE,A2:A5) joins the nonblank values using a line break between them.
After entering the formula, select the result cell and choose Home > Wrap Text so Excel displays the lines within the cell. You may also need to adjust the row height; double-clicking the boundary below the row number can autofit it to the contents. The combined value is still one cell even though it appears on multiple lines.
Line breaks are helpful for presentation, but they can complicate copying the result into other applications or splitting it later. If the destination expects one continuous line, use a comma, space, or another single-line delimiter instead. In Excel for Mac and the web, the formula works the same way, though ribbon layout can vary slightly by interface.
Alternatives and the Data Consolidate command
CONCAT is another function for combining text. It can join cell values but does not provide a delimiter argument or an option to ignore blank cells. With A2 containing North, A3 containing South, and A4 containing East, =CONCAT(A2:A4) returns NorthSouthEast. You could add separators manually with &, but for a range that needs a repeated delimiter, TEXTJOIN is more direct.
Do not confuse joining text with Excel’s Data > Consolidate command. That command is designed to summarize data from ranges using operations such as Sum, Count, or Average, or to combine numeric information by position or category. It is not a text-concatenation tool. If the goal is to turn several labels into a single sentence or list, use a formula such as TEXTJOIN instead.
For a one-time result, a formula is still a practical starting point: copy the result cell, then use Home > Paste > Paste Values to replace the formula with its current text result. This is useful before sending a workbook to someone who should see a fixed value rather than a live link to the source cells.
Common problems and limits
- The formula shows as text. The cell may be formatted as Text, or the entry may start with an apostrophe. Change the cell format to General, then re-enter the formula.
- You see #NAME? Excel may not support
TEXTJOINin that version, or the function name may be misspelled. Try the ampersand method or use a supported version. - There are extra separators. Check whether the formula’s second argument is
TRUEand whether the source cells contain spaces rather than being truly empty. A cell containing spaces is not an empty cell. - The result is in the wrong order. The formula follows the order of the source range. Sort or rearrange the source data before combining it.
- The result is too long. Excel limits a cell’s contents to 32,767 characters. A formula that produces a result beyond the cell-content limit can return an error, so consider splitting the output or reducing the source data.
One subtle issue is that a visually blank cell may contain a formula that returns an empty string. With ignore_empty set to TRUE, TEXTJOIN skips empty text values as well as genuinely empty cells. By contrast, a cell containing one or more spaces is not empty, even if you cannot easily see those spaces. That can create apparently blank gaps in a joined result.
Keep the result live or make it permanent
A formula-based result updates when its source cells change. That is ideal for a report or template that is refreshed regularly, but it may not be what you want for a final export. When you need a fixed snapshot, copy the formula cell and paste values over it or into another location. The pasted text no longer changes when the source range is edited.
Before replacing formulas, consider keeping the original source data or saving a separate copy of the workbook. A joined cell is convenient to read, but it is less useful for sorting, filtering, or analyzing individual entries than the original one-value-per-cell layout. In most workbooks, retain the structured source list and treat the consolidated cell as a display or export field rather than as a substitute for the underlying data.
Frequently Asked Questions
Can I combine text from multiple cells without spaces?
Yes. Use TEXTJOIN with an empty delimiter, or connect a small number of cells with & and no quoted space. The values will run together, so include punctuation if readers need to distinguish them.
How do I combine cells and skip blanks?
Use TEXTJOIN with TRUE as its second argument, followed by the range. For example, with values in A2:A10, =TEXTJOIN(", ",TRUE,A2:A10) joins nonblank entries with comma-space separators.
Can Excel combine text from different columns?
Yes. You can supply multiple references to TEXTJOIN, or combine selected cells with &. A range can also include adjacent columns, but check the resulting reading order because Excel follows the range’s cell order.
Can I join cells into one cell with line breaks?
Yes. Use CHAR(10) as the delimiter in TEXTJOIN, then turn on Home > Wrap Text for the result cell. Adjust the row height if the lines are not all visible.
Will the combined result update automatically?
Yes, if the result is a formula and Excel is set to calculate automatically. It updates when referenced values change. Pasting the result as a value makes it a fixed snapshot instead.
Related
- Does Excel Online Have Goal Seek? What to Use Instead
- Excel Delimited Text to Columns: How to Split Data
- Defining Print Area in Excel: Setup and Printing Tips
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel: Consolidate Two Columns Into One Without Losing DataTo combine the contents of two Excel columns side by side, enter =A2&" "&B2 in a new column,…
- Conditional Formatting Rows in Excel: How to HighlightTo conditionally format entire rows in Excel, select the rows or range you want formatted, choose Home >…
- Copilot Not Responding in Excel? Fixes to TryIf Copilot is not responding in Excel, first confirm that you are signed in with an account and…
- Consolidate Values in Excel: Steps and OptionsTo consolidate values in Excel, select the destination cell, choose Data > Consolidate, select a summary function such…
- How to Add a Drop-Down in Excel with Custom OptionsTo add a drop-down in Excel, select the cells, go to Data > Data Validation, choose List under…
- How to Create Plain Labels in Word Without a TemplateTo create a plain sheet of blank labels in Microsoft Word, open Mailings > Labels, choose the product…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.