Hey,

as point 4 is unclear, well elaborate it ! (Sort each section ok but what is the key column ?!)
Or just post an attachment of the expected result according to your initial attachment …