Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting consecutive negative value Wallace Excel Worksheet Functions 6 April 20th 10 06:47 PM
Counting strings of consecutive numbers in a column SamG Excel Discussion (Misc queries) 1 January 27th 10 07:25 AM
Counting consecutive numbers in a list Wiseguy91 Excel Worksheet Functions 1 January 12th 10 03:52 AM
Counting Consecutive Numbers in a List Wiseguy91 Excel Worksheet Functions 1 January 12th 10 03:51 AM
Counting consecutive numbers in a list Wiseguy91 Excel Worksheet Functions 0 January 11th 10 11:07 PM


All times are GMT +1. The time now is 11:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"