As the reference does not match Debit & Credit like in your blue sample …

I'm lost with the grey one starting in cell E20, what is the logic to follow ?