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:

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,739
Office Version
  1. 2010
Platform
  1. Windows
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:

Watch MrExcel Video

Forum statistics

Threads
1,113,909
Messages
5,544,999
Members
410,647
Latest member
LegenDSlayeR
Top