Lỗi cannot sort a table containing merged cells

When trying to sort data in Excel, you may have encountered an error indicating that merged cells must be the same size. This usually happens when you copy and paste data from a source to Excel. Sometimes, this forces excel to merge some cells without you even noticing.

To fix this issue, you simply need to unmerge all cells in the sheet. That sounds like a lot of work, but it can actually be done with only a few clicks – here’s how.

  1. Click the Select All button to the left of column A and above row 1. You can also simply press Ctrl + A on your keyboard [Cmd + A on a Mac].
  2. Under the Home tab, click the small arrow to the right of Merge & Center and select Unmerge Cells.
  3. Finally, try and sort the data again. You should no longer receive the error about merged cells!

Just a hunch: When columns are not perfectly aligned, Word tables can get confused. This can happen, for instance, when a cell's vertical border is moved, inadvertently or not.

It can also be difficult to see. I recommend enlarging the view so that even a slight misalignment will show. Another detective technique is to select each column individually and see if the selection jumps to a horizontally neighboring cell at any point.

If you find a cell wall that needs adjusting, select the cell, with or without adjacent cells, or the row, and use Alt+drag to fine tune the alignment at an enlarged view.

Trong quá trình làm việc trên Excel, có lúc bạn sao chép dữ liệu nhưng không thể sao chép được và có thông báo “We can’t do that to a merged cell” hiện lên. Hãy theo dõi bài viết sau để biết cách giải quyết trường hợp này.

Khi có thông báo này hiện lên có nghĩa là dữ liệu có ô bị merged khiến bạn không sao chép được. Để giải quyết ta cần tìm ra những ô đó rồi tắt merge. Để thực hiện, các bạn hãy làm theo các bước sau:

Bước 1: Các bạn bôi đen toàn bộ dữ liệu. Sau đó nhấn tổ hợp phím tắt Ctrl + H để mở hộp thoại Find and Replace. Sau đó các bạn chọn thẻ Find rồi nhấn vào Options.

Bước 2: Tiếp theo các bạn nhấn vào Format.

Bước 3: Lúc này, hộp thoại Find Format hiện ra. Các bạn chọn thẻ Alignment. Sau đó đánh dấu tích chọn vào mục Merge cells. Cuối cùng nhấn OK để hoàn tất.

Bước 4: Bây giờ các bạn nhấn Find All. Excel sẽ tìm ra các ô bị merge và hiện danh sách bên dưới. Các bạn nhấn vào từng mục rồi chọn thẻ Home trên thanh ribbon. Sau đó nhấn tắt Merge & Center. Chỉ cần tắt merge của tất cả các ô trong phần dữ liệu cần sao chép là các bạn đã có thể sao chép một cách bình thường.

Như vậy, bài viết trên đã hướng dẫn các bạn cách khắc phục lỗi “We can’t do that to a merged cell” khi sao chép trong Excel. Hy vọng bài viết sẽ hữu ích với các bạn trong quá trình làm việc. Chúc các bạn thành công!

Trong file Excel nhiều lúc xảy ra một số vấn đề mà nguyên nhân do xuất hiện những ô hợp nhất [Merged Cell] , ví dụ như phép lọc không được hoàn toàn , dịch chuyển cột dữ liệu bị lỗi …

Làm thế nào để nhận biết và đánh dấu những ô đang Merge Cell ?

Bấm tổ hợp phím CTRL-F để mở cửa sổ Find and Replace , chọn tab Find > Options > Format

Chọn tab Alignment , đánh dấu tích vào Merge cells , bấm OK

Lúc đó quay trở lại Find and Replace , bấm Find All . Khi đó tất cả những ô Merged Cell sẽ được liệt kê

Clicking a third time, I get the "Can't sort with merged cell" message. What actually happens on the third click is that the table is returned to the default sort.

However, it does look like there is a sort bug on strings from my experience. It looks like sorting only applies to the first word in a string

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

You may receive an error message when you sort a range that contains merged cells in Excel

  • Article
  • 07/21/2022
  • Applies to: Excel for Microsoft 365, Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007

In this article

Symptoms

When you sort a range in a Microsoft Excel worksheet, Excel does not sort the range. Additionally, you may receive the following error message:

This operation requires the merged cells to be identically sized.

Cause

This issue might occur if you sort a range of cells, and if the following conditions are true:

  • You previously merged some of the cells, but not all of the cells in the sort range.
  • You previously merged all of the cells in the sort range and the cells are not all the same size.

Workaround

To work around this issue, split all the merged cells in the range, or merge all the cells in the range so that the merged cells are the same size. Each merged cell in the range must occupy the same number of rows and columns as the other merged cells in the range.

General solution

  1. Select the entire range you want to sort.
  2. In the Alignment group on the Home tab, select the Alignment dialog box launcher.
  3. Select the Alignment tab, and then clear the Merge cells check box.
  4. Select OK.

Note

This can alter the layout of the data in the range.

Example solution

  1. In a worksheet, type the following data:

    A1: B1: Name C1: Value A2: B2: Sue C2: 1 A3: B3: Tom C3: 2

  2. Merge cells A1 and B1, A2 and B2, and A3 and B3. To do this, follow these steps:
    1. Select each pair of cells.
    2. Select the Alignment dialog box launcher in the Alignment group on the Home tab.
    3. Select the Alignment tab, and then select the Merge cells check box.
    4. Select OK. Do not merge cells in column C.
  3. Select cells A1:C3, select Sort & Filter in the Editing group on the Home tab, and then click Custom Sort.

In the Sort box, select "Column C" next to Sort By, and then select OK. You should see the error message as documented above.

Chủ Đề