Formatting Issues

How to Fix Excel Merged Cells Must Be the Same Size Error When Sorting

Natalie TaylorNatalie Taylor Nov 3, 2026 872 views

Question details

The user needs to resolve an error preventing them from sorting data due to inconsistent merged cell sizes.

How to Fix the 'Merged Cells Must Be the Same Size' Error in Excel
Product
Excel
Device & OS
not provided
Scenario
Attempting to sort a selected range of data that contains identically or variably sized merged cells.
Observed behavior
Excel blocks the sorting operation and displays a prompt stating that all merged cells must be the same size.
Before you start

Before unmerging your cells, identify which columns contain the merged data so you can properly realign or fill in the blank cells once they are separated.

Solution 1Recommended

Unmerge Cells to Allow Data Sorting

The most effective way to fix this sorting error is to remove all merged cells within your selected data range and structure the data in standard rows and columns.

Excel requires a uniform grid structure to sort data accurately. When cells are merged across different rows or columns, Excel cannot determine how to rearrange the blocked data.

By unmerging the cells, you restore the standard grid, allowing sorting features to function normally.

1
Select the affected range

Highlight the entire data range you are trying to sort. Alternatively, click the triangle in the top-left corner of the sheet or press Ctrl + A to select the entire worksheet.

2
Locate the Merge & Center option

Navigate to the 'Home' tab on the top ribbon and locate the 'Alignment' group.

3
Unmerge the cells

Click the drop-down arrow next to 'Merge & Center' and select 'Unmerge Cells' from the menu. All previously merged cells will now be separated into individual cells.

4
Fill empty cells and sort

After unmerging, you may have blank cells. Fill in the missing data to ensure consistent rows and columns. Once your data is uniformly arranged, highlight the range again and apply your sorting criteria.

Unmerge Cells to Allow Data Sorting
Alternative to Merging: Instead of merging cells across columns, use the 'Center Across Selection' feature. Right-click the selected cells, choose 'Format Cells', go to the 'Alignment' tab, and select 'Center Across Selection' from the Horizontal drop-down. This centers your text without breaking the grid structure.
Resolve Sorting Errors Easily

Use WPS Spreadsheet to Manage and Sort Data Seamlessly

WPS Spreadsheet offers powerful data management tools, allowing you to easily unmerge cells, clean up your formatting, and sort large datasets without frustrating structural errors.

  1. 1. Open your file in WPS: Launch WPS Spreadsheet and open the document containing the problematic merged cells.
  2. 2. Unmerge the cells: Select your data range, go to the 'Home' tab, click the 'Merge and Center' drop-down, and choose 'Unmerge Cells'.
  3. 3. Sort your data safely: Navigate to the 'Data' tab, click 'Sort', and organize your rows effortlessly without encountering cell sizing errors.
Fully compatible with Microsoft Excel (.xlsx, .xls) files and formatting.Quickly identify and unmerge cells with intuitive alignment tools.Lightweight and completely free alternative for your daily spreadsheet needs.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel show the 'merged cells must be the same size' error?

This error occurs because Excel cannot sort rows or columns if they contain cells merged across different ranges. Sorting requires a strictly uniform grid structure, and varying merged cell sizes disrupt this logical grid.

How can I quickly find all merged cells in a large worksheet?

You can locate them using the 'Find and Replace' tool. Press Ctrl + F to open the dialog, click 'Options', then click 'Format'. Navigate to the 'Alignment' tab, check the 'Merge cells' box, and click 'Find All' to generate a list of every merged cell in the document.

Can I keep my table titles centered without merging cells?

Yes. Select the adjacent cells you want the title to span across, right-click, and select 'Format Cells'. Under the 'Alignment' tab, change the 'Horizontal' text alignment to 'Center Across Selection'. This provides the exact same visual effect as merging, but keeps the individual cells intact for safe sorting.