A possible solution I have found is :
I add an extra column, use ABS, then I sort on ABS and then use the following :
On row 1 : If (A2= -A3, "contra",0)
On the rest: If (B2 = "contra", "contra1", if (A3= - A4, "contra",0))
The above works except for cases where I have 2 debits...