Merging Cells in Excel – A Guide


In the example below B6:B14 are merged using the Merge & Center feature:

Excel Merge Cells

 


What Does ‘Merge Cells’ Mean in Excel?

‘Merge Cells’ means combining cells into a bigger one but keeping the value of the 1st cell only.

D6:D11 contain the same values:

What is Merge Cells

  • Merge D6:D11 and it will act like a single cell. Merge Cells

 


Merge Cells vs Combine Cells

Combining cells means combining the data of multiple cells into one single cell. Merging cells means combining multiple cells into one.

See the difference in the image below:

Merge Cells vs Combine Cells

Formulas are used to combine the values of multiple cells.

Cells are merged using the Merge & Center feature, which works for adjacent cells only.


Things You Need to Know Before Merging Cells in Excel

  • Merging cells can cause problems when sorting or filtering data.
  • If you refer to merged cells in a formula, you may not get the correct output.
  • You cannot use the Merge and Center feature directly in an Excel table. You must convert the Table to a range.
  • When using Data Validation or Conditional Formatting, avoid merged cells.

How to Merge Cells in Excel – 4 Examples

This is the sample dataset.

Sample dataset


Example 1 – Merging Cells Using the ‘Merge & Center’ Command

1.1 Merge Two Cells in Excel

To merge B6 and B7:

  • Select B6 and B7 cells.
  • In the Home tab >> go to Alignment >> click Merge & Center.

Merge Two Cells in Excel

  • In the warning message, click OK.

Warning from Microsoft Excel about removing other values

This is the output.

Merged cells

To merge B6 and C6:

  • Select B6 and C6.
  • In the Home tab >> click Merge & Center.

Merging two cells horizontally

Notes

1.2 Merge and Center Cells of an Entire Column in Excel

B6:B14 contains the same value: 101. To merge and center the content of these cells:

  • Select B6>> press CTRL + SHIFT + ↓ (Down-Arrow key) to select the column.
  • In the Home tab >> Click Merge & Center.

Merge and Centre Cells of a Column in Excel

  • In the warning message, click OK.

Merged entire column


1.3 Merge Multiple Cells Vertically

Cells in column B are empty, except for B6. To merge B6:B14:

Merge Multiple cells-data

  • Select B6:B14 >> in the Home tab >> go to Alignment >> click Merge & Center >> Wrap Text.

Merge Multiple Cells Vertically in Excel

This is the output.

Merged multiple cells

Read More: How to Merge Cells in Excel Without Merging


1.4 Merge Multiple Cells in the same Row

  • Select B6:F6  >>in the Home tab >> go to Alignment  >> Merge & Center >> Merge Across.
  • Apply the same procedure to B13:F13.

Merged Multiple Cells using Merge Across


Adding the Merge & Center Feature to Quick Access Toolbar

  • In the Home tab >> go to Merge & Center.
  • Right-click an option. Here, Merge Cells.
  • Select Add to Quick Access Toolbar.

Adding Merge & Center Feature to Quick Access Toolbar

You will see the Merge Cells option in the Quick Access Toolbar.

Added Merge & Center Feature to Quick Access Toolbar

Read More: How to Move Merged Cells in Excel


Example 2 – Merge Cells Using Keyboard Shortcuts

  • To merge cells vertically, select the cells and press ALT+H+M+M.
  • To merge cells inthe same row, press ALT+H+M+A.
  • To center align, press ALT+H+M+C.
  • To unmerge cells, press ALT+H+M+U.
  • For Mac, press Control+Option+M to merge cells.

Example 3 – Merging Cells with a VBA Code

  • Go to the Developer tab >> select Visual Basic.

Opening Visual Basic window

 

  • Select Insert >> Module >> enter the following code in Module 1.
Sub merging_cells()
Application.DisplayAlerts = False
Selection.Merge
End Sub
  • Save the code.

Merge Cells with Excel VBA

Use a button to run the code:

  • Go back to the worksheet >> Developer tab >> Insert.
  • In Form Controls >> Click Button (Form Control).

Inserting Button Form Control

  • Drag the Button to the worksheet.
  • In Assign Macro, select the sub-procedure merging_cells
  • Click OK.

Assigning macro to that button

  • Select B6:B8 and click Button 1.

Using button to merge cells

This is the output.

output of VBA code

 

Merge Cells with Excel VBA

Read More: How to Merge Cells in Excel with Data


Example 4 – Use the Alignment Feature for Merging Cells

  • Select the cells >> press CTRL+1 to open Format Cells.
  • Go to Alignment>> Text control >> check Wrap text and Merge cells.
  • Click OK.

Use of Alignment Feature to Merge Cells in Excel


How to Merge Cells in an Excel Table

You can’t merge cells in an Excel table:

Convert the table into a range.

Merge & Center feature grayed out in Excel table

  • Select a cell in the table>> go to Table Design >> Tools.
  • Click Convert to Range.

Converting the table into range

  • In the message box, click Yes.

Getting info from Microsoft Excel

  • Use the Merge & Center feature to merge cells.

Merging cells of converted range

Notes

You can convert this range back into a table by pressing CTRL+T, but the merged cells will automatically be unmerged.


How to Move Merged Cells in Excel

  • Go to Developer >>Visual Basic >> Microsoft Visual Basic window.
  • Select Insert >> Module >> enter the code in Module 2.
Sub move_merged_cells()
Selection.Cut Range("H6")
End Sub

Move Merge Cells using Excel VBA

The code will paste your selection in H6.

  • Select a merged cell>> Developer >> Macros.
  • Select move_merged_cells >> click Run.

The merged cells will move to H6.

Moving Merge Cells in Excel

Click on the GIF to view it in full-size


How to Find Merged Cells  in Excel

  • Press CTRL+F to open the Find and Replace dialog box.
  • Click Format.

Find Merged Cells

  • In Find Format >> go to Alignment.
  • In Text control >> check Merge Cells >> Click OK.

Activating Merge Cells command in Find format

  • Click Find All.

Merged cells are displayed.

Finding Merged Cells


Why Can’t I Merge Cells in Excel?

Possible reasons:

  • Cells are part of a table.
  • The worksheet is protected: Go to Review >> Protect >> Unprotect Sheet.
  • The worksheet is shared: Go to Review >> Protect  >> Unshare Workbook.
  • The cell is in edit mode: Press ENTER to close the editing mode.

How to Merge Cells Without Losing Data

1. Using Excel Formulas to Merge Two Cells

To merge two non-adjacent cells: B6 and E6 keeping the cell values:

  • Go to a blank cell (H6) >> enter the following formula.
=CONCATENATE(B6,"-",E6)

use of CONCATENATE function to combine cells

You can also use the CONCAT function:

=CONCAT(B6,"-",E6)

use of CONCAT function to combine cells

Alternatively, use the ampersand operator to connect two cells keeping the values.

  • Go to H6  >> enter the formula below >> press ENTER.
=B6&E6
  • Drag down the Fill Handle.

Use of Ampersand operator to combine cells


2. Applying the TEXTJOIN Function to Combine Multiple Cells

To combine B6:E6:

  • Use the formula:
=TEXTJOIN(",",TRUE,B6:E6)

Applying TEXTJOIN Function to Combine Multiple Cells


3. Merge Cells in One Column Using the Justify Feature

  • Expand column B so that all values (B6:B12) are displayed.
  • Select B6:B12>> Go to the Home tab >> Editing >> Fill >> Justify.
Combine Cells Within One Column Using Justify Feature

Click on the image to have a detailed view

This is the output.

Combine Texts in one cell

Read More: How to Merge Data from Multiple Workbooks in Excel


An Alternative to Merging Cells in Excel: Inserting a Text Box

  • Go to the Insert tab >> Text >> select Text Box.
  • Drag the Text Box to the sheet.

Inserting Text Box

  • Double-click the Text Box >> go to the Formula Bar.
  • Enter =$C$16 >> press ENTER.

Use of Text Box as an Alternative to Merge Cells

  • Insert another Text Box >>  go to the Formula Bar >> enter =$E$16 >> press ENTER.

Insert another Text Box to keep long text


How to Unmerge Cells in Excel

  • Select the merged cells (B6:B8) >> Home  >>Merge & Center >> Unmerge Cells.

How to Unmerge Cells in Excel

This is the output.

Unmerged cells

Notes

If you unmerge cells, the value takes the place of the uppermost left cell. The other cells remain empty.


Download Practice Workbook

 


Excel Merge Cells: Knowledge Hub


<< Go Back to Merge in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Musiha Mahfuza Mukta
Musiha Mahfuza Mukta

Musiha Mahfuza Mukta is a marine engineer who loves exploring Excel and VBA programming. To her, programming is a time-saving tool for dealing with data, files, and the internet. She's skilled in Rhino3D, Maxsurf, C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. With a B.Sc in Naval Architecture & Marine Engineering from BUET, she's shifted gears and now works as a content developer. In this role, she creates techy content exclusively focused on Excel... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo