Difficulties with a formula to count continous instances

Patrokles

New Member
Joined
Sep 11, 2014
Messages
2
Dear all,

I hope you can help me out with a problem I can't figure out myself.
The problem is that I have a data sheat, in which I need to measure the longest uninterrupted number of intervals that the variable is below a certain number. Lets say 37. And the zero's are not included. In the following row the variable is 7 times below 37, and the maximum length of longest uninterrupted number of intervals is 4.
So basically I am looking for a formula that gives me the number 4.
I hope somebody is able to help me out


0
28
26
0
23
26
27
29
38
40
33
0

<tbody>
</tbody>
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi.

Assuming your list is in A1:A12 and you put your threshold value, e.g. 37, in B1, this array formula** should give you your desired result:

=MAX(FREQUENCY(IF(B1>A1:A12,IF(A1:A12<>0,ROW(A1:A12))),IF((A1:A12>=B1)+(A1:A12=0),ROW(A1:A12))))

Regards


**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
 
Upvote 0
Thank you for your swift respons. However, Excel keeps showing an error message after pressing CTRL + SHIFT + ENTER. The error concerns the part A1:A12,ROW. It appears to be that the comma is the cause of the error.
Note: I use a dutch version of Excel.

Regards
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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