Excel All Cells Must Be the Same Size Error Explained

Errors & fixes · Updated November 2, 2026

Excel All Cells Must Be the Same Size Error Explained

The Excel message “To do this, all the merged cells need to be the same size” usually means the selected range contains merged cells with different shapes. To fix it, unmerge the affected cells, or make the merged areas consistent, then repeat the operation; ordinary differences in row height or column width are not usually the cause.

What the error means

Excel treats a merged area as one cell that spans multiple rows, columns, or both. For example, merging A1:C1 creates one cell three columns wide. Merging A2:B2 creates a different-width cell. If you select a range containing both merged areas and ask Excel to sort, copy, paste, or otherwise rearrange it, Excel may not be able to map the merged shapes to the new layout. It can stop and report that merged cells must be the same size.

The wording can vary between Excel versions and operations, but the important clue is “merged.” The message does not mean every worksheet cell must have identical dimensions. A worksheet can have different column widths and row heights; that is normal. The problem is typically a mismatch among merged areas within the selection involved in the action.

Why merged cells cause trouble

Merging changes the structure of a range, not just how its contents look. In a merged area, only the upper-left cell holds the value; the other cells in the area are combined into it. That makes the range behave differently from a plain grid of independent cells. Operations such as sorting expect rows and columns to have a consistent structure, while a merged cell can cross the boundaries those operations need to move.

Imagine a report where A1:D1 is merged for a title, but A2:B2 and C2:D2 are merged separately. Selecting A1:D2 and trying to sort the rows can leave Excel unable to determine how the differently sized merged areas should move. Similarly, copying a block with one merged layout into a destination with another layout can fail. Even if the cells look aligned on screen, their underlying merge patterns may not match.

How to identify the merged cells

Start by noting the exact range selected when the error appeared. The merged area may be inside that range, or it may overlap an edge of it. Look for labels or headings that visually span several columns or rows. Select a suspected area and check the Home tab’s Merge & Center control or its dropdown; the Unmerge Cells command is available when the selection includes merged cells.

For a larger or unfamiliar worksheet, Excel’s Find feature can help locate cells by formatting. On Windows, choose Home > Find & Select > Find, open the Format options, and inspect the Alignment settings for merged cells before choosing Find All. The exact dialog layout can differ slightly by Excel release. Review the results rather than assuming every match is part of the problem: formatting searches can identify cells that share a format, and the relevant merge may be in a neighboring range.

Also check hidden rows or columns and worksheet sections outside the visible area. A selection extending farther than expected can include a merged title or note. If the sheet is protected, you may need permission to change its structure before you can unmerge anything.

Fix it by unmerging the affected range

If the merged appearance is not essential, unmerging is generally the most reliable repair. In Excel for Microsoft 365 on Windows:

  1. Select the affected range. If you are unsure which part is merged, select the table or block involved in the failed operation and inspect it carefully.
  2. Go to Home > Merge & Center, then open the dropdown and choose Unmerge Cells. If the selection contains more than one merged area, check that the selection is limited to the cells you intend to change.
  3. Try the original action again. If it still fails, inspect the selection for other merged cells, including ones just outside the apparent data table.

Unmerging does not restore values that were discarded when the cells were first merged. A merged area stores its content in the upper-left cell; any other content that existed in the cells before merging would have been removed at merge time. Unmerging leaves the retained value in the upper-left cell and makes the cells separate again. Check important labels and formulas before changing a carefully prepared worksheet.

Excel for Mac has the same general merge and unmerge controls on the Home tab, although ribbon layout and dialog details can vary. In Excel for the web, look for the merge control on Home; some commands or selection workflows may differ from the Windows desktop version. If you cannot find a control, consult the command search or help available in your edition rather than changing unrelated formatting.

Keep the heading without merging

Often, a merge was used only to center a heading across several columns. You can usually get a similar visual result without creating a merged cell. Select the cells across which the heading should appear, open Format Cells, choose the Alignment tab, and set Horizontal to Center Across Selection. This centers the text visually across the selected cells while keeping the cells separate, which is more compatible with sorting, filtering, copying, and filling ranges.

Other options include placing the heading in one cell and using Center alignment, widening the first column, or using Wrap Text and adjusting row height. These choices may require a slightly different layout, but they preserve a regular cell grid. Avoid merging cells inside the actual data rows of a table; keep merged titles and decorative labels outside the sortable data whenever possible.

When the problem appears during sorting or filtering

Merged cells are a frequent obstacle when sorting a range that includes a heading or data area. Excel needs to move complete records without breaking their row structure. If one record contains a cell merged across two columns and another row does not, the range is no longer a consistent list of independent fields. Unmerge cells in the data area, ensure each record uses one row, and keep column headings in a single, unmerged header row.

Before sorting, select a cell in the data and use the sort controls, checking that Excel identifies the intended range and recognizes headers correctly. If the sheet contains a decorative merged title above the list, exclude that title from the sort range. If you need to keep the original presentation, consider making a copy of the worksheet first, then create a clean, unmerged data range for sorting and filtering.

Distinguish it from other Excel size errors

Excel can show other messages that sound similar but have a different cause. A paste operation may complain that the copy area and paste area are not the same size. That often means the copied range and destination selection have different row or column counts; selecting a single destination cell and pasting a rectangular block can resolve that particular mismatch. It is not the same as a warning about merged cells.

Likewise, cells with different row heights or column widths do not by themselves create this merged-cell error. If the warning explicitly mentions merged cells, focus on merged areas first. If it mentions the copy area, paste area, or a multiple selection, check the size and shape of the selection instead. Reading the full message helps avoid changing useful formatting when the actual issue is simply an incompatible destination range.

Prevent the error in shared workbooks

For workbooks that people regularly sort, filter, paste into, or update, use merges sparingly. Keep the data itself in a rectangular table with one header row and one record per row. Place report titles and explanatory notes above or beside that table, rather than merging cells through its records. This makes the workbook easier to maintain and reduces surprises when another person selects a large range.

  • Use Center Across Selection or ordinary alignment for headings that span columns visually.
  • Keep imported or pasted data unmerged, especially in columns used for sorting and filtering.
  • Before a structural edit, save a copy if the sheet has complicated formatting or important labels.
  • When the warning appears, inspect the precise selection before unmerging a whole worksheet.

Frequently Asked Questions

Does this error mean my row heights or column widths must match?
No. Different row heights and column widths are usually fine. The message generally points to merged cells with inconsistent merged dimensions in the range involved.

Will unmerging delete the text in a merged cell?
The retained value stays in the upper-left cell when you unmerge. Unmerging does not recover content that was lost from other cells when the area was originally merged.

Why can’t I sort a range that contains merged cells?
A merged area can span fields or records, so Excel cannot always move the selected rows while preserving a consistent grid. Unmerge cells in the data range and keep each record on one row.

Can I keep a heading centered across columns without merging?
Yes. In Format Cells > Alignment, set Horizontal to Center Across Selection. This centers the heading across selected cells without combining them.

Could the error be caused by selecting the wrong paste range?
Possibly, but check the exact wording. A message about copy and paste areas usually points to mismatched range dimensions; a message about merged cells points to inconsistent merges in the selection.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Errors & fixes

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.