Sorting sublists by a parameter

Hello,

I am looking for a way to sort sublists by a parameter value.
As seen in the picture below, in sublist 0, the following values belong the the corresponing families:

0 - 5000
1 - 5000
2 - 8000
3 - 10000
4 - 10000
5 - 8000

What i want is:
0 - 5000
1 - 5000
2 - 8000
3 - 8000
4 - 10000
5 - 10000

And so on for the sublists to follow. Could someone help me?

Thanks!

List.SortByAnother.

List.GroupByKey

Both can work.