Merging Two Cells In Excel

Join data from cells into one by formula. Here we have one formula that can quickly merge two cells into one but keep both contents. Select one cell which you will place the result, type this formula =A1&' ' &B1, A1 and B1 are the cells you want to join together, “ “ is the separator between two cell contents, press Enter key, and drag fill handle down to apply the formula to cells.

Merging cells in a spreadsheet means taking two or more cells and constructing a single cell out of them. Merging is generally used as a cosmetic trick to center a title over a particular section in a spreadsheet.

  • Combine text from two or more cells into one cell. There are other times when “merging cells” refers to combining the actual data that is in multiple cells into one cell. This can be accomplished through concatenation. Three simple methods to concatenate or join values in Excel are shown below. They are: Using the concatenation operator.
  • Mar 04, 2021 The fastest and easiest way to combine two or more cells in Excel is to use the built-in Merge and Center option. The whole process takes only 2 quick steps: Select the contiguous cells you want to combine. On the Home tab Alignment group, click the Merge & Center.

The below image clearly shows how a merged cell looks like.

In this post, we will see different ways to merge cells in Excel. But before that let’s understand what makes merging different from concatenation.

How Merging is different from Concatenation?

Many times people confuse between these two words. As I have foretold, Merging is the process of taking two or more cells and constructing a single cell out of them. On the other hand, Concatenation is the process of joining or combining the values from two or more cells.

Recommended Reading: Concatenate Cells in Excel

There are different methods to merge cells in Excel. In the below section we will understand how to do this:

Method 1: Merging multiple cells using the Merge and Centre button in Ribbon

In this method, we will see how to merge cells in excel using the Merge and Centre Button in Excel. Follow the below steps to do this:

  • First of all, select the cells that you wish to merge.
  • After this navigate to the “Home” tab in the top ribbon and click the “Merge & Centre” button as shown in the below image.
  • This will merge all the selected cells and the output will look like the below image.

Method 2: Merging multiple cells using the Format Cells option

How to merge cell values excel

In this method, we are going to utilize the Format Cells option to merge the selected cells.

  • First of all similar to the previous method, select the cells that you have to merge.
  • Next, click the “More Options” button near the “Alignment Settings” on the “Home” Tab as shown.

Alternatively, you can also right-click the selected range and click the “Format Settings” option from the right-click menu.

Tip: You can also use the shortcut Alt + H F A for performing this.

  • After this “Format Cells” window will open. Now, in the “Format Cells” window navigate to the “Alignment” tab and check the “Merge” checkbox and click “Ok”.
  • This will merge the selected cells.

Method 3: How to Merge cells in Excel using VBA Macro:

If you wish to merge cells using a VBA program then you should try the below codes:

A. VBA Code to merge Selected sells:

This code merges the cells that are selected by the user. The code will only execute if the selected cells are greater than 1.

Recommended Reading: IF Statement, Message Box in VBA

A. VBA Code to merge Specified cells:

This code asks the user to enter a range, then it merges all the cells present in the specified range.

Recommended Reading: InputBox in VBA, Error Handling in VBA

Merge Cells Across

In the above methods, we have seen how easy it is to merge cells in Excel. But have you thought about how you can merge several individual rows in a range?

The below image will make our objective very clear.

If you select all the cells to be merged and then merge them using any of the methods, the output will be like this:

Option-1: One obvious solution to this would be selecting each row and then merging them individually. This solution will work but if you have a large number of columns then it can be quite cumbersome to merge every row individually.

Option-2: Using the “Merge Across” option. This is an easy way to accomplish our goal and that too in a split second.

Follow the below steps to know how to use this option:

  • First of all, select the range that you wish to merge as several individual rows.
  • Next, navigate to the “Home” Tab in Ribbon and click the dropdown arrow on the “Merge and centre” button. Now from the menu Click the option “Merge Across” as shown.
  • This will merge the cells as several individual rows.

How to Merge without losing data

Do you know that merging can sometimes also result in data loss? Yes, you read that right.

See the below image to know how it happens.

So, what’s the Solution?

The solution to this can be a simple macro that can first concatenate the values in all the selected cells into the upper-leftmost cell and then merge them together.

This boils down to:

Excel combine contents of two cells

This code has been written by Chandoo, you read more ways to tackle this issue on his blog here.

Why Merging sometimes leads to issues:

Merging in excel can cause problems while sorting. If you try to sort your data containing some merged cells, Excel will throw an error saying that, “To do this, all merged cells should be of same size”.

So, I will suggest you minimize the use of Excel’s merging capability.

Merge Two Cells In Excel Keeping Data

Recommended Reading: Find merged Cells in Excel

How To Merge Columns In Excel

So, this was all from my side. Do let me know in case you come across any issues while trying to merge cells in Excel.