Learn Excel
EN
Sets how numbers, dates and formulas look, so everything works just like your own Excel.

Home › Excel basics › Merge cells

How to Merge Cells in Excel

To merge cells in Excel, select them and click Home › Merge & Center. The cells become one big cell, typically used for a title above a table. Be careful: Excel only keeps the value of the top-left cell. To combine the contents of cells, use a formula instead (see below).

In this guide
  1. Merge cells
  2. Combine text without losing data
  3. Merge vertically
  4. Merge many blocks quickly
  5. Unmerge cells
  6. Better: Center Across Selection
  7. Problems with merged cells
  8. Keep learning
  9. FAQ

Merge cells

  1. Select the cells to merge, for example A1:D1.
  2. Click Home › Merge & Center, or open the arrow next to it for more options.
OptionWhat it does
Merge & CenterOne cell, text centred. Shortcut: Alt, H, M, C
Merge AcrossMerges each selected row separately: A1:D3 becomes three merged rows
Merge CellsOne cell, alignment unchanged
Unmerge CellsSplits merged cells back into separate cells

Data loss: if more than one cell has a value, Excel warns you that only the upper-left value is kept. The rest is deleted.

Try it yourself: select A1:D1 and click Home › Merge & Center. Turn on JavaScript to practise this in an interactive Excel window.

Combine text from two cells without losing data

To get "Anna Smith" from a first name in A2 and a last name in B2, don't merge: join them in a new column.

=A2 & " " & B2

Or for several cells with a separator, in Excel 2019 and later:

=TEXTJOIN(", ", TRUE, A2:D2)

Fill down, then copy the column and paste as values if you want to delete the originals. See CONCATENATE, & and TEXTJOIN. Flash Fill (Ctrl+E) also works: type the first full name and press Ctrl+E.

Merge cells vertically

Merge & Center also works down a column: select A2:A5 and click it to get one tall cell, for example a group name next to four rows. Merge Across does nothing here, because it works row by row.

The text is centred from left to right but sits at the bottom of the tall cell. Click Home › Middle Align (the middle one of the three buttons at the top left of the Alignment group) to put it in the middle.

Want the values of several rows in one cell, each on its own line? Don't merge, use a formula in a new cell:

=TEXTJOIN(CHAR(10), TRUE, A2:A5)

CHAR(10) is a line break. Turn on Home › Wrap Text for that cell, otherwise the lines run together.

Merge many blocks quickly

Need the same merge in many places, for example a heading above every block? Merge the first one, select the next cells and press F4: Excel repeats the last action. Keep selecting and pressing F4 for the rest.

Format Painter copies a merge too: click the merged cell, double-click Home › Format Painter and click the first cell of each new spot. Excel merges the same number of cells there. Press Esc to stop.

Want a key of your own? Right-click Merge & Center and choose Add to Quick Access Toolbar. Press Alt to see which number it got; from then on Alt plus that number merges the selection.

Unmerge cells

Select the merged cell and click Merge & Center again, or choose Unmerge Cells. The value ends up in the top-left cell; the other cells are empty.

To find all merged cells: Ctrl+F › Options › Format › Alignment, tick Merge cells and click Find All. Or select the whole sheet (Ctrl+A) and click Unmerge once.

After unmerging a column you often want the empty cells filled with the value above. Select the column, press F5 › Special › Blanks, type =, press the up arrow and confirm with Ctrl+Enter.

The better alternative: Center Across Selection

Merged cells cause trouble with sorting, filtering, copying and selecting columns. You can get the same look without merging:

  1. Type the title in the first cell (A1) and select A1:D1.
  2. Press Ctrl+1 and go to the Alignment tab.
  3. Under Horizontal, choose Center Across Selection and click OK.

The title is centred over the four columns, but each cell stays separate. This only works horizontally; for vertical merges there's no equivalent.

Problems caused by merged cells

  • "To do this, all the merged cells need to be the same size" when sorting. Unmerge first.
  • You can't paste into part of a merged cell.
  • Row height doesn't auto-fit with wrapped text.
  • Formulas only see the first cell; the others count as empty.
  • Merge & Center is greyed out when you're editing a cell, the sheet is protected, or the cells are in an Excel table.

Frequently asked questions

What's the shortcut to merge cells in Excel?

There's no single key, but you can press Alt, H, M, C in sequence for Merge & Center, or Alt, H, M, U to unmerge.

How do I merge two columns into one?

Use a formula like =A2 & " " & B2 in a third column, fill it down, then paste it as values and delete the original columns.

How do I split a cell in Excel?

You can only split a cell that was merged before (Unmerge). To split the content of one cell over several columns, use Text to Columns.

Can I merge cells in Google Sheets the same way?

Yes, via Format › Merge cells, with the same options and the same data-loss warning.

How do I refer to a merged cell in a formula?

Use the top-left cell. If A1:D1 is merged, the value is in A1, so write =A1. B1, C1 and D1 are empty: =B1 returns 0.

Why does my filter only show the first row of a merged block?

Only the top cell of a merged block holds the value; the cells below it are empty. Filter on that value and Excel hides the empty rows. Unmerge the column, fill the empty cells with the value above (see Unmerge cells) and filter again.