Formula for Sum of Max Consecutive Negative Values D5:D29

thankyou

Board Regular
Joined
Aug 13, 2008
Messages
189
Hi. I've done some research here but I'm afraid I haven't yet found the answer. I'm looking for a sum formula that will do these things:

1. SUM the largest streak of negative numbers in that range.(aka "max drawdown")
2. SUMthe largest streak of positive numbers in that range.(aka "max runup")

and then these 2 simple Counts:

1) # of consecutive cells bearing the longest streak of neg #s
2) # of consecutive cells bearing the longest streak of positive #s

No VBA or arrays if you don't mind. Just a formula like:

=SUM (etc)

I respect your time and experience.

thankyou
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
but I need my colums which includes 0s.

I have peters forumula but this does not work with zeros (did not take part)
 
Upvote 0
dear sir,

your answer is the most accurate because sometimes max consecutive count doesn't match max consecutive sum, and this is the other answers don't take in considerations

Then what about some helper columns to keep the formulas somewhat simpler?



If I have interpreted that correctly then try this.

E4 remains empty.
E5 & F5 copied down to row 29.

Streaks 2

DEFGHI
4value countsum
5-2-1-2neg1-5
611 pos422
712
813
9144
10-5-1-5
1151
1252
1353
145420
15-2-1-2
1621
1720222
18-2-1-2
19

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:50px;"><col style="width:35px;"><col style="width:35px;"><col style="width:55px;"><col style="width:55px;"><col style="width:61px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
E5=IF(D5="","",IF(D5<0,IF(D4<0,E4-1,-1),IF(D4<0,1,E4+1)))
F5=IF(SIGN(E5&0)=SIGN(E6&0),"",SUM(D$5:D5)-SUM(F$4:F4))
H5=-MIN(E5:E29)
I5=MIN(F5:F29)
H6=MAX(E5:E29)
I6=MAX(F5:F29)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0

Forum statistics

Threads
1,216,438
Messages
6,130,632
Members
449,584
Latest member
c_clark

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top