How to Remove Hidden Merged Cells in Excel Before Sorting
Question details
The user needs to find a way to remove hidden or partially merged cells in an Excel worksheet because they are preventing the data from being sorted properly.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Attempting to sort a dataset or worksheet containing hidden or hard-to-find merged-cell formatting that causes an error.
- Observed behavior
- Excel displays a sorting error due to merged cells, and the built-in Find tool fails to locate the merged formatting.
Before clearing all merged formatting, ensure you save a copy of your worksheet, as unmerging cells might shift your visual data layout or alter how headers are displayed.
Clear Merged Formatting via Format Cells
This method globally clears all merged formatting across your selection, fixing the sorting issue even if the Find command fails to locate the specific merged cells.
By selecting the entire worksheet and overriding the alignment settings, you ensure that no hidden merged cells are left behind to disrupt your data operations.
Click the triangle in the top-left corner of the spreadsheet grid (between row 1 and column A), or press Ctrl+A on your keyboard.
Press Ctrl+1 to quickly open the Format Cells window.
Navigate to the Alignment tab. Locate the Merge cells checkbox. If it is partially selected (showing a square or dash), click it once to fully select it, and then click it again to completely clear the box.
Click OK to apply the changes. All merged-cell formatting is now removed, allowing you to sort your worksheet successfully.

Unmerge Cells via the Ribbon
A quick visual method using the Home tab to unmerge all cells in a specific range without needing to open additional dialog boxes.
Fix Merge Cell Issues Easily with WPS Spreadsheet
WPS Spreadsheet offers a highly compatible and intuitive interface for managing your data, unmerging cells, and sorting complex worksheets without unexpected errors.
- 1. Open your file: Launch WPS Office and open your spreadsheet file.
- 2. Select the data: Press Ctrl+A to select the entire worksheet or highlight the data range you wish to sort.
- 3. Unmerge cells: Right-click and choose Format Cells, then navigate to the Alignment tab and uncheck the Merge cells option.
- 4. Sort effortlessly: Navigate to the Data tab and apply your sort conditions without encountering any merge-related errors.

Frequently Asked Questions
Why does Excel say 'To do this, all the merged cells need to be the same size'?
This error occurs when you attempt to sort a range that contains one or more merged cells. Spreadsheet software requires all cells in a sorted range to be individual, unmerged cells of uniform size so that rows and columns can shift correctly.
Why can't I find the merged cells using the Find command?
Sometimes the Find Format tool fails to locate partially merged formatting, particularly in newer versions like Microsoft 365. Selecting the entire sheet and clearing the format manually via the Format Cells dialog bypasses this limitation.
Will unmerging cells delete my data?
No, unmerging cells will not delete your data. The data contained in the previously merged cell will simply be placed into the upper-leftmost cell of that range, while the surrounding cells will become blank.
How can I locate merged cells if I don't want to unmerge everything?
You can press Ctrl+F to open the Find dialog, click Options, click Format, go to the Alignment tab, and check Merge cells. Click Find All to see a list of all merged cells in your sheet. However, if this fails due to a software bug, the global unmerge method is recommended.




