Excel Equation to Merge Cells? The Real Answer

How-to basics · Updated November 19, 2026

There is no Excel equation that merges cells: formulas calculate values, but they cannot change the worksheet layout. To merge cells in Microsoft Excel for Microsoft 365 on Windows, select the range and choose Home > Merge & Center; if you meant combining the text inside cells, use a concatenation formula instead.

Why an Excel formula cannot merge cells

A worksheet formula returns a result in a cell. It can calculate a number, return text, or refer to other cells, but it cannot alter the structure or formatting of the sheet. Merging is a layout action, so Excel provides it as a ribbon command rather than a built-in equation. Typing a made-up formula such as =MERGE(A1:B1) will not work because Excel has no worksheet function named MERGE.

This distinction matters because “merge” can mean two different things. You might want one larger cell that spans several columns, or you might want the contents of several cells joined into a single text value. The first is a formatting change; the second is a calculation. Excel handles them in different ways, and joining text with a formula is often safer when the data will later be sorted, filtered, or used in other calculations.

How to merge cells with the ribbon

In Excel for Microsoft 365 on Windows, select the adjacent cells you want to combine, then go to Home > Merge & Center. The button’s main command merges the selection and centers its content. For other behaviors, open the dropdown beside the button and choose the option you need. You can also select the range first and use the dropdown to choose a merge command directly.

  1. Select a rectangular range, such as A1:C1. The cells must be next to one another.
  2. Open the Home tab and locate the Alignment group.
  3. Choose the dropdown beside Merge & Center, then select Merge Cells, Merge Across, or Merge & Center as appropriate.
  4. Read any warning about data in multiple cells before confirming. Excel keeps only the value in the upper-left cell.

Excel for Mac also provides merge commands on the Home tab, in the Alignment area; the ribbon may be arranged differently depending on the window size. There is no identical default Mac keystroke for the Windows ribbon sequence. On Windows, Alt, H, M, C is the KeyTip sequence for Merge & Center. Excel for the web also has merge commands on its Home ribbon, though the available controls and their placement can vary with the interface.

What the merge options do

The dropdown offers several choices, and they do not all produce the same alignment or shape:

  • Merge & Center combines the selected cells into one larger cell and centers the retained content.
  • Merge Cells combines the selection without applying the centering command. The resulting cell’s alignment depends on its formatting.
  • Merge Across merges cells separately across each row of the selected range. Selecting A1:C3, for example, creates three merged cells: A1:C1, A2:C2, and A3:C3.
  • Unmerge Cells removes the merged layout and restores the individual cell boundaries.

These commands change how a range is displayed and selected; they do not combine the underlying records into a new data structure. After merging A1:C1, the merged cell is anchored at A1. Excel does not create three independent places to store a value within that merged area.

What happens to existing cell contents

This is the most important caution: if more than one selected cell contains data, Excel retains the content of the upper-left cell and removes the other contents from the merged range. It displays a warning before proceeding, but it is easy to overlook. For a selection from A1 to C1, the value in A1 is kept; values in B1 and C1 are not preserved in the merged cell.

Copy or combine any information you need before merging. If the cells contain separate labels or names, put the combined result in a new cell, check it, and only then decide whether the presentation needs a merged area. Unmerging later restores the cell boundaries, but it does not bring back values that were discarded during the merge. If you have already merged cells and want to undo the action, Ctrl+Z on Windows (Command+Z on Mac) may reverse it immediately, provided you have not moved too far past the action in the undo history.

Use a formula to combine text instead

If your goal is to put two pieces of text together, use a formula rather than merging the source cells. For example, with a first name in A2, a last name in B2, and the formula entered in C2, use =A2&" "&B2. If A2 contains Maya and B2 contains Chen, the result in C2 is Maya Chen. The ampersand joins the values, and the quoted space inserts a space between them. The original names remain in their own cells.

For a longer list of cells, TEXTJOIN can add a chosen separator and optionally skip empty cells. With the words North, Sales, and 2026 in A2:C2, and the formula entered in D2, use =TEXTJOIN(" ",TRUE,A2:C2). The result is North Sales 2026. The first argument is the separator, TRUE tells Excel to ignore empty cells, and the final argument is the range to combine. TEXTJOIN is available in current Microsoft 365 Excel and in Excel 2019 and later.

A formula result is still a value displayed in one cell; it does not merge the cells it refers to. If you need a fixed label rather than a live calculation, copy the formula result and use Paste Special > Values before removing or changing the source data. If you need a heading that appears centered across columns, you can then use a visual alignment option instead of merging the underlying cells.

Center a heading without merging

For many headings, Center Across Selection provides the appearance people want without creating a merged cell. Select the cells across which the heading should appear, open the Format Cells dialog, choose the Alignment tab, and set the Horizontal option to Center Across Selection. In the selected range, place the heading text in the leftmost cell and leave the cells to its right empty. Excel centers the text across the selection while keeping the cells separate.

This approach is useful when the sheet needs to remain easy to navigate or when other rows and columns will be sorted, copied, or formatted. It is not the same as Merge & Center: the cells remain independent, so the heading is not stored in a single merged area. For reports with a title spanning several columns, it is often a practical compromise between appearance and worksheet flexibility.

Common problems and better choices

Merged cells can complicate ordinary spreadsheet tasks. Sorting a range with merged cells may fail or produce confusing results, and merged cells are not allowed inside an Excel table. They can also make it harder to select consistent ranges, fill formulas down, paste data, or navigate with a keyboard. If a worksheet is a working dataset rather than a static report, keeping each value in its own cell is usually the more reliable design.

Consider the purpose of the sheet before choosing a method:

  • For a decorative report title, a merge command may be acceptable if the range is not part of a sortable dataset.
  • For a heading that should look centered but remain easy to edit, use Center Across Selection.
  • For names, addresses, or labels that must become one text value, use a formula such as the ampersand example or TEXTJOIN.
  • For a data table that will be filtered, sorted, or analyzed, avoid merged cells and keep one field per column.

If you need to reverse a merge, select the merged cell and choose Home > Merge & Center > Unmerge Cells. On Windows, Alt, H, M, U is the corresponding ribbon KeyTip sequence. Unmerging restores the separate cells, but the original content-loss rule still applies: it cannot recover values removed when the range was first merged.

Frequently Asked Questions

What is the formula to merge two cells in Excel?
There is no formula that merges the cells themselves. To join their text, use an expression such as =A1&" "&B1 in another cell, with the values in A1 and B1. To create one larger cell, select the range and use Home > Merge & Center.

Does merging cells delete data?
It can. If several cells in the selected range contain content, Excel keeps the upper-left cell’s value and removes the others from the merged result. Combine or save the contents first if you need them.

Can I merge cells without centering the text?
Yes. Open the Merge & Center dropdown on the Home tab and choose Merge Cells. To center text across a range while keeping the cells separate, use Center Across Selection in the Format Cells dialog instead.

How do I merge cells in Excel without losing data?
First combine the values you need in a separate cell with a formula or copy them elsewhere. Confirm the combined result is correct before merging. Excel does not automatically concatenate all selected cell contents when you merge.

Can I sort or filter merged cells?
Merged cells can interfere with sorting and other data operations, and Excel tables do not support merged cells. For sortable or filterable data, keep cells unmerged and use a separate heading or Center Across Selection for presentation.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

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

Spotted an error in this guide? Let us know.