Conditional Counting + Comparison

klosheen

New Member
Joined
Aug 15, 2014
Messages
18
Hi,

Below is a table with the daily settlment price for ICE Brent Futures. Highlighted in red are three consecutive days on which Brent finished in the red. I would like to be able to find the last time Brent suffered three consecutive daily losses or more. In other words, I would like to be able to make statements similar to the following: "This is Brent's longest losing streak since the [# of days] ended [date]."

Many thanks for all your help in advance.




EpuD4jI.jpg
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
4000
3000
-1110
-2122
3000
4000
5000
6000
5000
4000
3000
-4110
-5120
-4130
-3140
-2155
2000
3000
4000
5000
6000
4000
-2111
3000
4000
now use =large(D1:D25,1)
to find biggest losing streak

<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
Hi oldbrewer,

I have tried what you suggested but it doesn't seem to work. I am not looking for the "biggest losing streak" ever, but for the last time the current losing streak has either been matched or surpassed. I am also ashamed to say I couldn't understand the table you provided - is it just a random example or does it relate to the one I had provided?

Many thanks for your input.
 
Upvote 0
my table demonstrates that you can first of all "mark" the negative numbers, then count how many in each block, then note how many in each block. If I added a date column I could tell you when the last time a run of "N"occurred
 
Upvote 0
my table demonstrates that you can first of all "mark" the negative numbers, then count how many in each block, then note how many in each block. If I added a date column I could tell you when the last time a run of "N"occurred

Does that mean I have to "mark" the negative values manually? That it is not very practical for what I want to do.

Anyway, thanks again for your help.
 
Upvote 0
Hi,

Is there any chance you can post some data which isn't a screenshot? Perhaps a smallish sample size together with your desired results.

Regards
 
Upvote 0
Hi,

Is there any chance you can post some data which isn't a screenshot? Perhaps a smallish sample size together with your desired results.

Regards


Hi XOR LX,


That was my first choice but I am not allowed to post attachments. Will I be breaking any forum rules if I link to a Google Drive copy of the file?

Many thanks.
 
Upvote 0
finding the negative numbers is done automatically by a formula in a helper column, other helper columns find each "negative run length". So if current negative run = 4 you only need to find the last time a run of 3 occurred - this is very easy to do - but is it what you want?
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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