Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default compressing long columns into subset averages

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default compressing long columns into subset averages

Enter this formula in B1 and copy down as needed:

C1 = 10

=AVERAGE(OFFSET(A$1,(ROWS(B$1:B1)-1)*C$1,,10))


--
Biff
Microsoft 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?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default compressing long columns into subset averages

Typo:

C1 = 10
=AVERAGE(OFFSET(A$1,(ROWS(B$1:B1)-1)*C$1,,10))


Should be:

=AVERAGE(OFFSET(A$1,(ROWS(B$1:B1)-1)*C$1,,C$1))


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Enter this formula in B1 and copy down as needed:

C1 = 10

=AVERAGE(OFFSET(A$1,(ROWS(B$1:B1)-1)*C$1,,10))


--
Biff
Microsoft 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?





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default compressing long columns into subset averages

I tried this:
=AVERAGE(INDIRECT("D"&(8+$AJ$7*$AJ9)&":D"&(8+$AJ$7 *$AJ9+$AJ$7-1)))
where D8 is the first of the long column of data, and ak8 through a
large number contains the compressed averages, while aj8 and up count
the instances, starting with 0 in aj8. AJ7 contains the divider. Your
method is much more elegant. Thanks!

T. Valko wrote:
Typo:


C1 = 10
=AVERAGE(OFFSET(A$1,(ROWS(B$1:B1)-1)*C$1,,10))


Should be:

=AVERAGE(OFFSET(A$1,(ROWS(B$1:B1)-1)*C$1,,C$1))





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default compressing long columns into subset averages

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Margo Guda" wrote in message
...
I tried this:
=AVERAGE(INDIRECT("D"&(8+$AJ$7*$AJ9)&":D"&(8+$AJ$ 7*$AJ9+$AJ$7-1)))
where D8 is the first of the long column of data, and ak8 through a large
number contains the compressed averages, while aj8 and up count the
instances, starting with 0 in aj8. AJ7 contains the divider. Your method
is much more elegant. Thanks!

T. Valko wrote:
Typo:


C1 = 10
=AVERAGE(OFFSET(A$1,(ROWS(B$1:B1)-1)*C$1,,10))


Should be:

=AVERAGE(OFFSET(A$1,(ROWS(B$1:B1)-1)*C$1,,C$1))





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
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 2 July 31st 06 09:45 PM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 0 July 31st 06 05:07 PM
How to enter symbols for subset or element of a subset in Excel? rwcita Excel Worksheet Functions 1 January 23rd 06 09:27 PM
Averages from 2 columns Deb Pingel Excel Worksheet Functions 10 January 11th 06 07:45 PM
Possible to apply Autofilter to a subset of available columns? Paul Moore Excel Discussion (Misc queries) 2 June 1st 05 10:23 PM


All times are GMT +1. The time now is 01:13 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"