We want to count where the there is a pattern of 0,1,1 hence the equal size but offset ranges. It will count where the pattern matches. We also want to count if A1 and B1 both equal 1 because it should be positive but does not meet the pattern.
5
solved Count number of times value appears consecutively in a row – Excel