Forum Discussion

Mohsin Pasha's avatar
Mohsin Pasha
Copper Contributor
May 12, 2018

Formula to count a value appearing consecutively 2 or more times in multiple columns

Hi There,

 

I am looking for a formula, basically to count a string value appearing consecutively for 2 or more times in multiple columns. Have got an idea, however not sure about the implementation part. I have manually done it below, but a formula would really help a lot.

 

 

        Consecutive Pass
 Day1Day2Day3Day4Day5Day6 oncetwicethrice
Case1PassFailPassFailPassPass Yes  
Case2PassPassFailPassPassPass YesYes 
Case3FailPassPassPassPassFail YesYesYes
Case4PassFailPassPassPassPass YesYesYes
Case5PassPassFailPassPassPass YesYes 
Case6PassPassPassPassPassPass YesYesYes
Case7PassPassPassFailPassPass YesYes 
Case8PassPassFailPassPassPass YesYes 
Case9PassFailPassPassPassPass YesYesYes
Case10PassPassPassFailPassPass YesYes 

 

Any help on this front would be really appreciated. Please do let me know if any more details required.

 

Thanks

 

Mohsin

 

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    The first test can be achieved with a formula like this (assuming you are using Excel 2016):
    =IF(ISERROR(FIND("Pass|Pass",TEXTJOIN("|",FALSE,B2:G2))),"No","Yes")
    The Twice column needs a similar formula:
    =IF(ISERROR(FIND("Pass|Pass|Pass",TEXTJOIN("|",FALSE,B2:G2))),"No","Yes")
    And the Thrice column:
    =IF(ISERROR(FIND("Pass|Pass|Pass|Pass",TEXTJOIN("|",FALSE,B2:G2))),"No","Yes")

Resources