ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting Consecutive Numbers (https://www.excelbanter.com/excel-programming/392626-counting-consecutive-numbers.html)

Trav

Counting Consecutive Numbers
 
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

Trevor Shuttleworth

Counting Consecutive Numbers
 
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


"Trav" wrote in message
...
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




PapaDos

Counting Consecutive Numbers
 
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 ) )
--
Regards,
Luc.

"Festina Lente"


"Trav" wrote:

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



All times are GMT +1. The time now is 12:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com