Forum Discussion

Jakob2022's avatar
Jakob2022
Copper Contributor
Aug 16, 2022
Solved

Count if the number 1 is present 3 times or more beside eachother

Hi I am working with trend analysis in a cleaning company.  My question is if there is a count if formula which can help me count trend.  So I have the data below. I want to count if there is 3 or...
  • mtarler's avatar
    Aug 16, 2022

    Jakob2022 You can use SUMPRODUCT of overlapping ranges.

    Lets assume the range start on G1 and goes to K1 then use 

    =IF(SUMPRODUCT(G1:I1,H1:J1,I1:K1),"YES","no")

    by using the 3 ranges offset by 1 each, this sumproduct will multiply each set of 3 together and only get 1 if there are 3 next to each other and 0 every other time and then the sum will be >0 if it find at least 1 set of 3 (and will be more if there is more than 1 set of 3 or more together).

     

Resources