View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default compressing long columns into subset averages

Margo,

In cell B1, enter

=IF(COUNTA(A:A)($C$1*(ROWS($A$1:A1)-1)),SUM(OFFSET($A$1,$C$1*(ROWS($A$1:A1)-1),0,$C$1)),"")

and enter the value of N into C1.

Then copy down to match your data in A...

HTH,
Bernie
MS Excel MVP


"Margo Guda" wrote in message ...
Hello,
I am looking for an easy way to compress a large number of data, given in one long column, into a
shorter column that contains the average of every N cells. Say for instance I have a column with
one thousand numbers, and I want a new column of the one hundred 10-item averages. The averages
would be consecutive, so if A1:A1000 contains my data, B1 would contain average(A1:A10), B2 would
have average(A11:A20), and so forth. I would want N (here 10) to be user-specifiable (is that a
word?), or it could be taken from a cell. I can think of a worksheet to do this, but is there a
quick way to do it in the same worksheet that contains my data, e.g. using a function?