Sorting with merged cells

levy77

Board Regular
Joined
May 7, 2019
Messages
67
Hi,

I'm trying to sort the below table on the 'OVERALL' values, the issue I'm having is that as 'OVERALL', 'M/F' ... etc are all merged. When the sort is run essentially candidate 1 with all their data is sorted against all other candidates with all their data. Maybe some way of grouping or naming the ranges to then sort on a given value in the group or range.

Does anyone have any ideas?

Admin Note: Screenshot has been removed upon member's request due to sensitive information. As it is also explained in the original question above, cells are vertically merged and table needs to be sorted properly.
 
Last edited by a moderator:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
 
Upvote 0
You can do it with VBA. I have done it before with a sheet somewhat similar to yours. In your case, it may be necessary to convert the Excel table to range first, sort it, then, convert it back to an Excel table.

Can you write VBA scripts? If you can, here is the idea:
1. convert the Excel table to range,
2. un-merge everything,
3. insert two columns in the sheet. They can be anywhere in the sheet but it'd be easier if inserted before Col. A. I'll call them "new A" and "new B",
4. fill new A with overall,
5. fill new B with row number,
6. sort first by new A then new B. Sorting by new A is essentially sorting overall. Sorting by new B will keep the rows in its original order in the merged group.
7. re-merge cells,
8. delete new A and new B,
9. convert the range to an Excel table and it's done.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,978
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top