What merging cells does and when you should use it
Merging cells combines two or more adjacent cells into a single larger cell. Excel deletes the borders between them and treats the space as one cell. The content from the leftmost cell stays; content in the other cells is deleted. Merging is useful for headers that span multiple columns, labels that sit above grouped data, or titles that need visual emphasis across a wide area.
Before you merge, understand the trade-off: merged cells can break sorting, filtering, and formulas. If you sort data that includes merged cells, Excel may not sort correctly. If you use a merged cell in a calculation, the formula may behave unexpectedly. For most working spreadsheets, merged cells create more problems than they solve. Use them sparingly, and only in areas where you do not plan to sort, filter, or reference the data in formulas.
Key Takeaways
- Select the cells you want to merge, then use the Merge & Center button in the Home tab or right-click and choose Format Cells to access merge options.
- Merging deletes content from all cells except the leftmost one, so copy any data you need before you merge.
- Merged cells break sorting and filtering, so avoid merging cells in data ranges you plan to sort or filter later.
- Unmerge cells by selecting the merged cell, then clicking Merge & Center again or using Format Cells to turn off the merge.
How to merge cells using the ribbon
Open your spreadsheet and select the cells you want to merge. Click and drag from the first cell to the last cell, or click the first cell, hold Shift, and click the last cell. Both methods select a range.
Go to the Home tab at the top of the screen. In the Alignment group (toward the right side of the ribbon), you will see a button labeled Merge & Center with a dropdown arrow next to it. Click the dropdown arrow to see your options: Merge & Center, Merge Across, or Merge Cells. Choose Merge & Center to merge and center the text, Merge Across to merge without centering, or Merge Cells to merge without any automatic formatting. Click your choice, and the cells merge immediately.
How to merge cells using the Format Cells dialog
Select the cells you want to merge. Right-click anywhere in the selection and choose Format Cells from the menu. The Format Cells dialog opens.
Click the Alignment tab at the top of the dialog. In the middle section, you will see a checkbox labeled Merge cells. Check the box. You can also use the Horizontal and Vertical alignment dropdowns in the same dialog to control how text sits inside the merged cell. Click OK when you are done, and the cells merge.
What happens to your data when you merge
When you merge cells, Excel keeps only the content from the top-left cell and deletes everything in the other cells. If you select cells A1, B1, and C1, and A1 contains "Name", B1 contains "Age", and C1 contains "Location", the merge will keep only "Name" and discard "Age" and "Location".
Before you merge, copy any data you need from the cells that will be deleted. Paste that data elsewhere in the spreadsheet or into a text file so you do not lose it. After you merge, you cannot undo the data loss by unmerging — the content is gone. Undo (Ctrl+Z) immediately after merging will reverse the merge and restore the deleted content, but only if you have not made other changes.
How to unmerge cells
Click the merged cell to select it. Go to the Home tab and click the Merge & Center dropdown arrow. Choose Unmerge Cells. The merged cell splits back into separate cells, and the original content returns to the top-left cell.
Alternatively, right-click the merged cell, choose Format Cells, click the Alignment tab, and uncheck the Merge cells box. Click OK. Both methods unmerge the cell and restore the original cell boundaries.
Why merged cells cause problems with sorting and filtering
Sorting and filtering expect each column to have one value per row. A merged cell breaks that structure by occupying multiple rows or columns in a single cell. When you try to sort a range that includes merged cells, Excel may skip the merged cells, sort only part of your data, or display an error message.
Filtering has the same issue. If you apply an AutoFilter to a table with merged cells, the filter may not work correctly, or it may filter only the unmerged columns. For this reason, avoid merging cells within data ranges you plan to sort or filter. If you need a header that spans multiple columns, merge only the header row, not the data rows below it.
Merged cells and formulas
If you reference a merged cell in a formula, Excel treats the merged cell as a single cell with the address of its top-left corner. For example, if you merge cells A1 through C1, the merged cell is still called A1. A formula that references A1 will work, but it will only see the value in that one cell, not the values that were in B1 or C1 before the merge.
If you merge cells that are part of a range in a formula — for example, a SUM formula that adds A1:A10 — the merged cells may cause unexpected results. The formula may count the merged cell only once instead of once per row, or it may skip it entirely. Test your formulas after merging to make sure they still calculate correctly.
Frequently Asked Questions
Can I merge cells that are not next to each other?
No. Excel only merges adjacent cells — cells that touch each other horizontally, vertically, or diagonally. If you select cells that are separated by empty space, the Merge & Center button will be grayed out and unavailable. Select a continuous range and try again.
What happens if I merge cells with different data types?
Excel keeps only the content from the top-left cell and deletes the rest. If the top-left cell contains a number and the cell to its right contains text, the merged cell will show only the number. The text is deleted and cannot be recovered unless you undo immediately.
Can I merge cells in a table or pivot table?
You cannot merge cells within an Excel table or pivot table. These structures require each cell to remain separate so sorting and filtering work correctly. If you need to merge cells, do it outside the table, or convert the table to a regular range first by right-clicking and choosing Convert to Range.
How do I center text in a merged cell?
Use the Merge & Center option from the Home tab ribbon — it merges and centers in one step. If you already have a merged cell and want to change the alignment, right-click it, choose Format Cells, click the Alignment tab, and use the Horizontal and Vertical dropdowns to set your alignment. Click OK.
Will unmerging cells restore the original data?
Unmerging restores the cell boundaries, but the data that was deleted during the merge is gone. The top-left cell keeps its original content, and the other cells become empty. If you need that data back, undo the merge immediately after it happens, or restore it from a backup of your file.