I have got something that I think works but it is not just one column. I
don't guarantee that this is the simplest way, but it works on the figures
in your example.
Put the formulas in column's b through to f and copy them down alongside
a1 = 20
c1 = =IF(A1>0,A1,0)
d1 = =IF(A1<0,A1,0)
e1 = =+SUM($C$1:C1)
f1 = =+SUM($D$1:D1)
Thus column C displays positive entries of A
Column D displays Negative entries of A
Column E displays the total positive entries todate
Column F displays the total negative entries to date.
Coulmn B Checks for positive or negative values in A.if(a1>0,
Then checks if cumulative positive values are greater than total negative
values, if (e1+min(f1:f8)>0. If positive values are greater then use
minimum of A1 difference between cumulative positve values and total
You should be able to follow the rest of b1 yourself but if you have
problems please let me know.
Let me know if this helps please.
Best of luck