How to Fix Excel Merged Cells Must Be the Same Size Error When Sorting
Question details
The user needs to resolve an error preventing them from sorting data due to inconsistent merged cell sizes.

- 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 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.
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.
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.
Navigate to the 'Home' tab on the top ribbon and locate the 'Alignment' group.
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.
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.

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. Open your file in WPS: Launch WPS Spreadsheet and open the document containing the problematic merged cells.
- 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. Sort your data safely: Navigate to the 'Data' tab, click 'Sort', and organize your rows effortlessly without encountering cell sizing errors.

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.




