View Single Post
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

If the range will always start with 1 and you want to count from the first 1
you can use

=IF(COUNTIF(A1:A11,1)=COUNT(A1:A11),COUNT(A1:A11), MATCH(TRUE,A1:A11<1,0)-MATCH(1,A1:A11,0))


entered with ctrl + shift & enter

--
Regards,

Peo Sjoblom


"Stephen" wrote in message
...
Hi Everyone. I'm trying to figure out how to do a formula for the number
of
times 1 happened in a row starting from a certain date.
For example, from A1 I have 1,1,1,0,0,1,1,1,1,0,0 - I would like to get
the
answer of 3 (as starting from A1 I have 3 "1s" in a row, the rest of the
numbers aren't relevant). The max I want to be able to get is 11.
--
Thanks!

Stephen