excel formula - Count values in a range comprehended between two values -


at column have values 1 0 3 2 0 5 1 1 1 0 2 1 1 1 0 2 1 1 1 0 0 3 0 2 0 0 3 1

this list grows everyday. need formula put on every cell of column b counts upwards how many values bigger 1 until next value = 1 found. in words need count how many values larger 1 between 1's. pretended result this:

1
0
3
2
0
5
1 3
1
0
2
1 1
1
0
2
1 1
1
0
0
3
0
2
0
0
3
1 3

thanks in advance

i use helper column, if acceptable.

so create running count of numbers greater 1 resets each time encounters '1', enter starting in b2 , pull down (i'm assuming data has heading , list starts 1) :-

=if(a2=1,0,b1+(a2>1)) 

then display counts @ each '1' value (but not repeated ones) enter in c2 , pull down:-

=if(and(a2=1,a1<>1,isnumber(a1)),b1,"") 

enter image description here

it's possible array formula, not sure if it's worth effort:-

=if(and(a2=1,a1<>1),    countif(       offset(          a$1,          max(row(a1:a$2)*(a1:a$2=1))-row(a$1)+1,,          max(row(a1))-max(row(a1:a$2)*(a1:a$2=1))),       ">"&0),    "") 

to entered in b2 ctrl shift enter , pulled down.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -