Excel Positive/Negative Running Total

S

Scotty

I posted a message earlier and have received a partial solution.

I want to keep track of how much stock prices go up or down with a running
total of how much they go up or down over several days until the direction
changes.

The formula I am now using total the first and second day but does not do a
running total count if there are more than two up or down days in a row.
Your help is appreciated.

=IF(SIGN(H3)=SIGN(H4),H3+H4,H3)

However, the example below illustrates what I am looking for ---- column A
are the daily totals and column B is an example of how I want to calculate
the running total:
A B
Row
1 10 10
2 10 20
3 10 30
4 -5 -5
5 -5 -10
6 -5 -15
7 10 10
8 20 30
9 30 60
10 -5 -5
11 15 15
12 15 30

When the number is column A changes from positive to negative or negative
back to positive, I want to adjust column B until it changes again. Is this
possible?

Thanks.
 
P

Pete_UK

In B1 enter the formula =A1, then enter this formula in B2:

=IF(SIGN(A2)=SIGN(B1),B1+A2,A2)

Copy this formula down by double-clicking the fill handle (the small
black square in the bottom right corner of the cursor).

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top