Checking if a sequence of values is met

Ride The Lightning

Board Regular
Joined
Jul 14, 2005
Messages
238
Hi

I have a column of data with the values either True or False. I want to set up a formula that calculates if "True" appears 5 times in a sequence. I have tried the IF function and tried using it in an array, however, the formula doesn't account for the whole range.

Any pointers of what I could use would be much appreciated.

Cheers

RTL
 
=ISNUMBER(MATCH(5,(FREQUENCY(IF(A1:A10,ROW(A1:A10)),IF(NOT(A1:A10),ROW(A1:A10)))),0))
should do it.
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
This is ok for range A1:A100, assuming True and False as boolean (not text), and checks if there are exactly 5 ocurrences of True

=IF(ISNUMBER(MATCH(5,FREQUENCY(IF(A1:A100,ROW(A1:A100)),IF(NOT(A1:A100),ROW(A1:A100))),0)),"Yes","No")

Ctrl+Shift+Enter

M.
 
Upvote 0
Did you array enter it with Ctrl+shift+enter?
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,634
Members
452,934
Latest member
Jdsonne31

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