Well part of the problem you will face will is the variability of the number of rows you have. I was looking at your number columns and I made the assumption that anything with a number less than 5 in column C you are adding, and anything greater than 4 in Column C you are subtracting. In the row where you have the total and you are having your error use the following.
=SUMIF(Reference Range, Criteria, Range to Sum from)
Which for you translates to:
=SUMIF($C1:$C9,"<"&5,D1:D9)-SUMIF($C1:$C9,">=5",D1:D9)
Because I did not lock the D column I can copy this one column to the right and the D references will change to E.
The main thing this is doing is taking the sum of everything that has a value in column C less than 5 and then subtracting the sum of everything that has a value of greater than or equal to 5 in column C.
Now if the assumption about those values in column C are incorrect let us know because we could also do it for subtracting anything starting with Depreciation.