Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Need formula to calculate the average number of consecutive cells

Hello!

I have a column in Excel consisting of 1's and 0's. I need to
calculate the average size of consecutive cells (groups of cells)
containing 1's.

For example, the average size of consecutive cells containing the
number 1 in the following array is 3 (i.e., (2+4+3+3)/4 = 3):

1100111100000011100011100000


Can someone *please* suggest a formula to do this?

Thanks in advance!

Ilford
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 434
Default Need formula to calculate the average number of consecutive cells

hi, Ilford !

I have a column in Excel consisting of 1's and 0's.
I need tocalculate the average size of consecutive cells (groups of cells) containing 1's.
For example, the average size of consecutive cells containing the number 1
in the following array is 3 (i.e., (2+4+3+3)/4 = 3):
1100111100000011100011100000
Can someone *please* suggest a formula to do this?


assuming your array of numbers in [A2:A29]
and you can use [A30] as the "end-cell" (blank or whatever BUT 1's ) -?-

=sum(a2:a29)/sumproduct(--(a2:a29=1),--(a3:a30<1))

if any doubts (or further information)... would you please comment ?
hth,
hector.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Need formula to calculate the average number of consecutive cells


Thank you so much, Hector! The formula works perfectly and is easily
modified to work with my data.

Best wishes,

Ilford

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
Create Formula for Weighted Average in non-consecutive cells ferne Excel Worksheet Functions 1 August 4th 10 04:17 PM
Average non-consecutive cells excluding zero Excel-User-RR Excel Worksheet Functions 8 March 26th 09 01:45 AM
Average Non-consecutive Cells [email protected] Excel Discussion (Misc queries) 4 March 27th 08 03:26 PM
Calculating the Average for non consecutive cells using custom for BurghRocks Excel Discussion (Misc queries) 2 October 17th 07 07:49 PM
Calculate average pay from highest five consecutive years Chris Excel Programming 4 November 20th 03 12:13 AM


All times are GMT +1. The time now is 03:00 AM.

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"