What merging cells does and when to use it
Merging cells combines two or more adjacent cells into one larger cell. When you merge cells, the spreadsheet treats them as a single unit. This is useful when you want to create a title that spans across multiple columns, or when you need a header that covers a group of related data below it.
Merging is purely visual — it does not change your data or how formulas work. If you merge cells that contain different values, the spreadsheet keeps only the content from the top-left cell and discards the rest. For this reason, always check what is in each cell before you merge, or you may lose information without realizing it.
The most common use is creating a centered title across the top of a table, or grouping column headers under a single category name. You can also merge cells vertically to create a label that applies to multiple rows.
Key Takeaways
- Merging combines adjacent cells into one larger cell, and the spreadsheet keeps only the content from the top-left cell.
- In Excel, select the cells you want to merge, then use the Merge & Center button on the Home tab or the Format menu.
- In Google Sheets, select the cells, click Format, then choose Merge cells and pick whether to merge all cells or keep content separate.
- You can unmerge cells at any time by selecting the merged cell and choosing the unmerge option from the same menu.
- Merged cells can cause problems with sorting and filtering, so use them only for headers and labels, not for data you plan to rearrange.
How to merge cells in Excel
Start by selecting the cells you want to merge. Click on the first cell, then hold Shift and click on the last cell in the range. If the cells are not adjacent, you cannot merge them — they must form a rectangle on the page.
Once you have selected the cells, go to the Home tab at the top of the screen. Look for the Merge & Center button in the Alignment group — it looks like a box with lines inside it. Click the small arrow next to it to see your options. Choose "Merge & Center" to merge the cells and center the content, or "Merge Cells" to merge without centering. If you want to merge cells vertically without centering, use "Merge Cells" and then adjust the alignment separately.
If you do not see the Merge & Center button, you can also go to the Format menu, select Cells, click the Alignment tab, and check the box that says "Merge cells." This method gives you more control over how the merged cell behaves.
How to merge cells in Google Sheets
Select the cells you want to merge by clicking the first cell and dragging to the last one. The cells must be adjacent and form a rectangle. You can also click one cell, hold Shift, and click another to select a range.
With the cells selected, click the Format menu at the top. Scroll down and select "Merge cells." A submenu will appear with three options: "Merge all," "Merge horizontally," and "Merge vertically." Choose "Merge all" for a standard merge that combines all selected cells into one. The content from the top-left cell will be kept; content from other cells will be deleted.
Google Sheets will not center the content automatically like Excel does. After merging, you can click the merged cell and use the alignment buttons in the toolbar to center it if you want.
What happens to your data when you merge
When you merge cells that contain different values, only the content from the top-left cell survives. All other content is permanently removed. For example, if you merge three cells containing "Name," "Age," and "City," only "Name" will remain in the merged cell.
Before you merge, move any important data out of the cells that will be deleted. If you have a header row with labels in separate cells, delete or move those labels first, then merge the empty cells. This way you do not lose information by accident.
If you merge by mistake, press Ctrl+Z (or Cmd+Z on Mac) immediately to undo. You can also select the merged cell, go back to the merge menu, and choose "Unmerge" to split it back into separate cells.
Why merged cells can cause problems with sorting and filtering
Merged cells do not work well with sorting and filtering. If you try to sort a column that contains merged cells, the spreadsheet may not sort correctly or may give you an error. Filtering also behaves unpredictably with merged cells because the spreadsheet cannot match the merged cell to a single row of data.
For this reason, use merged cells only for headers, titles, and labels — not for the actual data you plan to rearrange. Keep your data in separate, unmerged cells so sorting and filtering work as expected. If you have already merged cells and need to sort, unmerge them first.
How to unmerge cells
Select the merged cell by clicking on it once. In Excel, go to the Home tab, click the arrow next to Merge & Center, and select "Unmerge Cells." In Google Sheets, click Format, select "Merge cells," and choose "Unmerge."
When you unmerge, the content that was in the merged cell will appear in the top-left cell of the range. The other cells will be empty. If you had content in those other cells before the merge, it will not come back — the merge operation deleted it permanently.
Alternatives to merging when you need a title or label
If you want a title that spans multiple columns but do not want the problems that come with merging, you can leave the cells separate and simply center the text across them visually. In Excel, select the cells, go to Format, choose Cells, click the Alignment tab, and select "Center Across Selection." This creates the visual effect of a merged cell without actually merging, so sorting and filtering still work.
Another option is to use a single cell for your title and leave the cells below it unmerged. You can make the title cell wider by dragging the column border, or you can simply accept that the title sits in one column while your data sits in multiple columns below it. This is often cleaner and avoids the sorting problems altogether.
Frequently Asked Questions
Can I merge cells that are not next to each other?
No. Merged cells must be adjacent and form a rectangle — you cannot merge cells that are separated by other cells or arranged in a scattered pattern. If you need to apply the same formatting to non-adjacent cells, select them all and format them together without merging.
What happens to formulas in cells I merge?
If you merge cells that contain formulas, only the formula in the top-left cell is kept. Formulas in the other cells are deleted. If you need those formulas, copy them to a different location before you merge, or unmerge and recalculate them afterward.
Can I merge cells in a pivot table?
No. Pivot tables do not support merged cells. If you need a title or label for a pivot table, place it in cells above or beside the table, not within the table itself.
How do I center text across merged cells?
In Excel, the Merge & Center button does this automatically. In Google Sheets, select the merged cell and click the alignment button in the toolbar, then choose center. You can also align left, right, or justify the text the same way.
Can I undo a merge if I already saved the file?
If you saved the file after merging, you cannot undo with Ctrl+Z. However, you can still select the merged cell and unmerge it using the Format menu. Unmerging will split the cell back into separate cells, though any content that was deleted during the original merge will not return.