1) Edit the title of the post, because as it is now it's against rule 1 of: https://www.excelforum.com/forum-rul...rum-rules.html
something like "counting number of occurences since last bad item" or may be adding "conditional counting number of occurences since last bad item" etc.
2) Use such array formula in D2 and copy it down:
But please do not forget about point 1) above.
3) Note that we are comparing column B values with Good_and_two_spaces - your data has such values in column B
**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).
Bookmarks