Formula to Merge Two Cells in Excel: Examples & Tips

Formulas & functions · Updated November 21, 2026

To combine the contents of two cells in Excel, use a formula such as =A2&" "&B2. This assumes the first value is in A2 and the second is in B2; if A2 contains Ada and B2 contains Lovelace, the result is Ada Lovelace. The formula joins the cell contents with a space, but it does not physically merge the cells.

The basic formula for combining two cells

The ampersand operator (&) is the simplest way to join text in Excel. In the example above, the first reference contributes the contents of A2, the quoted space contributes one literal space, and the second reference contributes the contents of B2. Excel calculates the combined text in the cell where you enter the formula. The source cells remain separate and unchanged.

To join two values with no separator, use =A2&B2. With Ada in A2 and Lovelace in B2, this returns AdaLovelace. That is sometimes useful for codes or identifiers, but it usually makes names or phrases harder to read. You can place punctuation or other text between the references by putting it in quotation marks. For example, a comma and space can separate a last name and first name, while a hyphen can join parts of a product code.

Formulas recalculate when their referenced cells change. If you update B2 from Lovelace to Byron, the result changes accordingly. This makes concatenation useful for labels and reports that should stay connected to the original data, rather than being a one-time copy.

Choose a separator that fits the data

A separator is ordinary text enclosed in straight double quotation marks. Choose one based on how the combined value will be read or used. A space is common for names, a comma-space for readable lists, and a hyphen for identifiers. If no separator is wanted, leave the two references directly beside each other with the ampersand operator.

For example, with a city in A2 and a state abbreviation in B2, =A2&", "&B2 returns Seattle, WA. The assumed inputs are Seattle in A2 and WA in B2. For a first name in A2 and surname in B2, the space-separated formula from the opening example returns Ada Lovelace. The separator is part of the displayed result, not a change to either source cell.

You can also add a label as a separator or prefix. With the item name in A2 and its category in B2, =A2&" ("&B2&")" returns Notebook (Office) when A2 is Notebook and B2 is Office. This illustrates that a formula can join more than two pieces: each fixed text fragment needs quotation marks, and each cell reference is joined with an ampersand.

Combine more than two cells

For a small number of cells, keep adding references and separators. With values in A2, B2, and C2, =A2&" "&B2&" "&C2 joins them with spaces. If A2 is Ada, B2 is Byron, and C2 is Lovelace, the result is Ada Byron Lovelace. This approach is explicit, but it becomes cumbersome when a row has many cells or some of them may be empty.

For a range, TEXTJOIN can apply one delimiter between values and optionally ignore empty cells. With values in A2:C2, enter =TEXTJOIN(" ",TRUE,A2:C2). If the cells contain Ada, Byron, and Lovelace, it returns Ada Byron Lovelace. TEXTJOIN is available in Excel 2019 and later, including Microsoft 365. The second argument TRUE tells Excel to skip empty cells; FALSE would not skip them.

TEXTJOIN is particularly convenient when combining a list of tags or words across a row. The delimiter is inserted between the included values, rather than being added at the start or end. For a range that may contain blanks, this usually avoids repeated separators. If the cells are not next to one another, you can supply individual references as arguments instead of a continuous range.

Handle blank cells and extra spaces

A basic formula that inserts a space between two references will still insert that space when one of the cells is blank. For example, with Ada in A2 and B2 empty, =A2&" "&B2 returns Ada followed by a trailing space. It may not be visible in the worksheet, but it can matter if the result is copied into another system or used in a comparison.

For a row of cells, TEXTJOIN with its ignore-empty setting is a straightforward way to avoid separators for blank cells. Assuming A2 contains Ada, B2 is empty, and C2 contains Lovelace, =TEXTJOIN(" ",TRUE,A2:C2) returns Ada Lovelace with just one space. This behavior applies to cells Excel treats as empty. A cell containing a formula that returns an empty string can also appear blank, but results can depend on the exact source data and formula.

If you use the ampersand method, you can also build conditional logic for blanks, but that is more complex than necessary for many simple lists. Before adding complexity, check whether the source cells contain spaces rather than being truly empty. A cell that looks blank may have a typed space, and Excel can treat that as text rather than an empty value.

Preserve date and number formatting

When a formula joins a date or number to text, Excel may use the underlying stored value rather than the way the source cell is formatted. A date can therefore appear as a serial number, and a currency amount may lose its currency symbol or decimal formatting. The source cell’s visible number format does not automatically carry over as text during concatenation.

Use TEXT to specify how a date should appear in the combined result. Assuming A2 contains the word Invoice and B2 contains the date January 5, 2026, =A2&" — "&TEXT(B2,"mmm d, yyyy") returns Invoice — Jan 5, 2026. The format code inside TEXT controls the date’s appearance in the result; it does not change the actual date stored in B2.

For a number, TEXT can similarly apply a display format. Assuming A2 contains Item and B2 contains the number 1250.5, =A2&": "&TEXT(B2,"$#,##0.00") returns Item: $1,250.50 in a setup using that dollar-style format. If the workbook is used with another currency or regional convention, choose an appropriate format code for that context. Keep the value in its original numeric cell if you still need to calculate with it; the combined result is text.

Formula concatenation versus Merge Cells

“Merge two cells” can mean two different things in Excel. A formula concatenates the values into a result while leaving the original cells separate. The ribbon’s Merge Cells command combines worksheet cells into one larger cell area. These actions solve different problems: use a formula to assemble text or values, and use cell merging mainly for layout, such as centering a heading over several columns.

To physically merge cells in Excel for Microsoft 365 on Windows, select the adjacent cells, then choose Home > Merge & Center. The dropdown beside the command offers options such as Merge Cells and Merge Across, as well as Unmerge Cells when applicable. Merge & Center combines the selected area and centers its remaining content. Merge Cells combines the area without applying the centering behavior. Merge Across applies merging separately across each selected row.

Be careful when merging cells that contain data. Excel keeps the content of the upper-left cell in the selection and warns that other cell contents will be discarded. It does not join all the values into the upper-left cell. If you need to preserve every value, first combine them with a formula or copy the information elsewhere. On Excel for Mac, the merge controls are also on the Home tab; ribbon layout can vary with the window and version. The same distinction between a formula result and a merged cell applies.

Enter the formula and use its result

  1. Choose an empty cell for the combined result, rather than overwriting one of the source values.
  2. Type an equals sign, then enter the cell references and separators. For example, if the source values are in A2 and B2 and need a space between them, enter =A2&" "&B2.
  3. Press Enter. Excel displays the combined text in the result cell.
  4. To use the formula for other rows, copy or fill it down. Relative references adjust by row, so the next row will refer to A3 and B3.
  5. If you need a fixed text result rather than a live formula, copy the result cells and use Paste Special > Values. This replaces formulas with their current displayed results; keep a copy of the workbook or source data if you may need to revise the combination later.

On Windows, Ctrl+C copies selected cells, and Ctrl+V pastes. On Mac, the corresponding shortcuts are Command+C and Command+V. To paste only values, use the Paste Special options available from Excel’s Home tab or context menu; the exact dialog presentation can vary by platform. Pasting values is useful before sharing a workbook with a system that expects plain text, but it removes the automatic link to the source cells.

Common problems and how to fix them

  • The result has no space: Check that a separator such as " " appears between the cell references. Excel does not add spaces automatically.
  • A date displays as a number: Wrap the date reference in TEXT and provide a date format, as shown above.
  • The formula appears as text: Make sure the cell is not formatted as Text, and that the entry begins with an equals sign. If the cell was already set to Text, change its format to General and re-enter the formula.
  • There is an unexpected gap: Inspect the source cells for leading or trailing spaces. A separator in the formula can combine with spaces already present in the source text.
  • Other values disappear after merging: That is the behavior of the physical Merge Cells command, not a concatenation formula. Undo if possible, or restore the original data from a copy; do not use merging as a way to combine contents.

Also distinguish a formula error from a formatting issue. If the combined cell shows a result that looks wrong, click it and inspect the formula bar and source cells. A formula may be working correctly while one of the inputs contains an unexpected space, number format, or blank-producing formula.

When to use a formula instead of a merged layout

For data tables, a combined formula is generally more flexible than merging worksheet cells. Merged cells can interfere with sorting, filtering, selecting ranges, and filling formulas because a merged area is not a normal one-cell-per-record structure. If a heading needs to span columns, consider using Center Across Selection from the Format Cells alignment options instead of merging; it can create a centered heading without combining the cells themselves.

For a report, keep the source fields in their own columns and put the combined result in a separate column. That preserves the individual values for sorting and later analysis. If you only need a visual heading, use a layout feature rather than a formula. If you need a reusable text value assembled from fields, use concatenation. For a one-time export, copy the formula results and paste values after checking that the outputs look right.

Frequently Asked Questions

What is the simplest formula to merge two cells in Excel?
Use the ampersand operator, such as =A2&" "&B2, when the values are in A2 and B2 and need a space between them. Replace the quoted space with another separator, or remove it if no separator is wanted.

Can I merge two cells without losing data?
A formula can combine their contents without changing the source cells. The physical Merge Cells command keeps only the upper-left cell’s content and can discard content in the other selected cells, so combine or save the values before using that command.

How do I combine cells and skip blanks?
For values in A2:C2, use =TEXTJOIN(" ",TRUE,A2:C2). TEXTJOIN inserts spaces between the nonempty values and is available in Excel 2019 and later, including Microsoft 365.

How do I keep a date readable when joining it to text?
Use the TEXT function to specify the date’s display format before concatenating it. Otherwise, Excel may show the date’s underlying serial value instead of a familiar date format.

Will the combined result update if I edit either source cell?
Yes. A formula that refers to the source cells recalculates when their contents change. If you paste the result as a value, it becomes static and no longer updates from those cells.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.