Counting Consecutive Numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to count consecutive numbers,


0 0 0 0 0 0 0 0 0 0 0 (ie this would = 6)

countif(range, "=0") unless there is a blank and then reset the counter.


Thanks for any help
 
Assuming those zeros (or numbers) are in row 1 from A1 to L1:

In A2: =IF(A1="",0,1)
In B2: =IF(B1="",0,A2+1)

Then drag across from B2 to L2

Regards

Trevor
 
If your data is organized in a row, try this array formula (Ctrl-Shift-Enter):

=COLUMNS(range) - MAX( NOT( ISNUMBER(range) ) * ( COLUMN(range) - CELL(
"col", range ) + 1 ) )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top