Hello! I'm new to this forum, tho I have read many posts I have yet to post my own, so here it is!

In the following attachement I have a sorting issue i have tried different macros/formulas to sort. The "Start" sheet shows the raw data, and the "Finish" sheet shows the result I want.

The sorting process,

You can look at it as two big matrices divided into smaller ones:
"Big"
- Coloumns A:F (Ref:1)
- Coloumns G:J (Ref:2)
Divided into "smaller"
- Coloumns A2:F3
- Coloumns G2:J3 and so on..
and between the value "Total lines" in coloumn "A".

what I want is coloumns "J" and "D" to match eatchother, within the "Total lines" areas.

If there is more then one of the same observation in "J" or "D" I'd like there to be inserted a row, and the observation put there. If there is no match, it can just be listed below ref1 or ref2, respectively.

Does any of you know a simple way to sort this? Matrix array sorting with match? Alle suggestions are appreciated!

Sorting .zip