Please, I need a formula to count how many cells are equal to zero before some.
This is for a group of lateral columns.
I will drag the formula, so that it shows this information again and again until the last row:
A B
1
0
0
1 2 (there are 2 rows equal to zero until the previous number 1)
0
0
0
1 3 (there are 3 rows equal to zero until the previous number 1)
0
1 1 (there is 1 row equal to zero until the previous number 1)
Something like (in B2):
=IF(B2<>0,(COUNT HOW MANY ROWS ARE EQUAL TO ZERO UNTILL PREVIOUS NUMBER<>0),"")
But I don't want to define how many rows there can be between the numbers different of 0, could be 1 or 500 or more.
How to do this without mentioning its range?
Bookmarks