it seems to us that you want to reach something different:
groupby to account no
calculate the net values and have the result in output
May we ask you to resharpen the requirements and share the more detailed desctription with us. Especially a rule for regulating which other col values are to take (e.g. group member first …) would be recommended as well. Thanks