![]() |
Excel Positive/Negative Running Total
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. |
Excel Positive/Negative Running Total
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 On Mar 22, 1:09 pm, Scotty wrote: 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. |
All times are GMT +1. The time now is 05:34 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com