Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Macro to return averages within a column

I have a spreadsheet of data that will be increasing in number of rows and
number of columns, but within that data starting from cell "J1" I need to
average together the data in every five rows then move over 5 columns and
average together every five rows in that column. This needs to continue
until the column is blank (except for the value in the header in row 1).
Actually, if it helps the columns that I need to identify these averages will
always have the title "Output" in header row.

Any assistance with code would be greatly appreciated!

Thanks,
Holly
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Macro to return averages within a column

Hi Holly,

I love a challenge and it keeps me occupied. However, some of confirmation
of what is required and more info needed.

Am I correct in assuming that you have a header row so the first average
will be average of J2:J6 then J7:J11 then J12:J16 and so on to the end of the
data. This will be repeated for K2:K6, K7:K11, K12:K16 and for each column to
the end of the data.

What cells are the average results to be placed in? Can they be on another
worksheet?

How much data do you anticipate having?

Regards,

OssieMac

"hnyb1" wrote:

I have a spreadsheet of data that will be increasing in number of rows and
number of columns, but within that data starting from cell "J1" I need to
average together the data in every five rows then move over 5 columns and
average together every five rows in that column. This needs to continue
until the column is blank (except for the value in the header in row 1).
Actually, if it helps the columns that I need to identify these averages will
always have the title "Output" in header row.

Any assistance with code would be greatly appreciated!

Thanks,
Holly

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Macro to return averages within a column

Holly,

Further to my previous post, I have been reading and re-reading your
description and I am sure that I have not really comprehended what you want.
Can you post a sample of what it should look like?

Regards,

OssieMac

"hnyb1" wrote:

I have a spreadsheet of data that will be increasing in number of rows and
number of columns, but within that data starting from cell "J1" I need to
average together the data in every five rows then move over 5 columns and
average together every five rows in that column. This needs to continue
until the column is blank (except for the value in the header in row 1).
Actually, if it helps the columns that I need to identify these averages will
always have the title "Output" in header row.

Any assistance with code would be greatly appreciated!

Thanks,
Holly

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Macro to return averages within a column

OssieMac,

Yes, sorry I wasn't very clear to begin with. You are correct the averages
would be J2:J6, J7:J11 and so on. I would like those averages posted in
another worksheet within the same workbook. I would, however, need that
averaging to repeat every 5 columns, so it would pick back up at O2:O6,
O7:O11 and so on. This will be a continually growing amount of data and I
anticipate it growing to be a great deal of data (In fact I'm worried that
they'll run out of columns before they run out of data, but they are kind of
set on recording the data this way).

As an example (please note, in the interest of conserving space I only have
3 columns between data on the example, but in actuality there are 5)...
SHEET A
Series ID | Date | Study | Output | Date | Study | Output
A 6/1 A1 2.5 6/15 A2 3
B 6/1 B1 3.67 6/15 B2 2.8
C 6/1 C1 3.1 6/15 C2 1.4
D 6/1 D1 2.6 6/15 D2 2.5
E 6/1 E1 2.0 6/15 E2 2.1

I need the code to then calculate the average of those 5 rows in the columns
with the header "Output" and place those averages in Sheet B, i.e...

SHEET B
Date | Average Output | Date | Average Output
6/1 2.774 6/15 2.36

Hope that clarifies. Thanks, in advance for brainstorming this.

Holly


"OssieMac" wrote:

Holly,

Further to my previous post, I have been reading and re-reading your
description and I am sure that I have not really comprehended what you want.
Can you post a sample of what it should look like?

Regards,

OssieMac

"hnyb1" wrote:

I have a spreadsheet of data that will be increasing in number of rows and
number of columns, but within that data starting from cell "J1" I need to
average together the data in every five rows then move over 5 columns and
average together every five rows in that column. This needs to continue
until the column is blank (except for the value in the header in row 1).
Actually, if it helps the columns that I need to identify these averages will
always have the title "Output" in header row.

Any assistance with code would be greatly appreciated!

Thanks,
Holly

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Macro to return averages within a column

Can do what you want but still need more info. Your example indicates that
you want the Dates displayed with the Averages so I need to know where the
Dates are in relation to the Output. Can you let me know which column has the
Dates for the Output in column J and which column has the Dates for Output in
Column O. (I am assuming that it is probably columns E and N.)

Regards,

OssieMac

"hnyb1" wrote:

OssieMac,

Yes, sorry I wasn't very clear to begin with. You are correct the averages
would be J2:J6, J7:J11 and so on. I would like those averages posted in
another worksheet within the same workbook. I would, however, need that
averaging to repeat every 5 columns, so it would pick back up at O2:O6,
O7:O11 and so on. This will be a continually growing amount of data and I
anticipate it growing to be a great deal of data (In fact I'm worried that
they'll run out of columns before they run out of data, but they are kind of
set on recording the data this way).

As an example (please note, in the interest of conserving space I only have
3 columns between data on the example, but in actuality there are 5)...
SHEET A
Series ID | Date | Study | Output | Date | Study | Output
A 6/1 A1 2.5 6/15 A2 3
B 6/1 B1 3.67 6/15 B2 2.8
C 6/1 C1 3.1 6/15 C2 1.4
D 6/1 D1 2.6 6/15 D2 2.5
E 6/1 E1 2.0 6/15 E2 2.1

I need the code to then calculate the average of those 5 rows in the columns
with the header "Output" and place those averages in Sheet B, i.e...

SHEET B
Date | Average Output | Date | Average Output
6/1 2.774 6/15 2.36

Hope that clarifies. Thanks, in advance for brainstorming this.

Holly


"OssieMac" wrote:

Holly,

Further to my previous post, I have been reading and re-reading your
description and I am sure that I have not really comprehended what you want.
Can you post a sample of what it should look like?

Regards,

OssieMac

"hnyb1" wrote:

I have a spreadsheet of data that will be increasing in number of rows and
number of columns, but within that data starting from cell "J1" I need to
average together the data in every five rows then move over 5 columns and
average together every five rows in that column. This needs to continue
until the column is blank (except for the value in the header in row 1).
Actually, if it helps the columns that I need to identify these averages will
always have the title "Output" in header row.

Any assistance with code would be greatly appreciated!

Thanks,
Holly



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Macro to return averages within a column

Hi Again Holly,

Further to my previous post, I have done some work on a macro which I think
will do what you want but it still needs a little tidying up.

I must have been in fairy land when I worked out which columns that I
thought the dates would be in. Having looked a bit closer I have made the
assumption that for Output in columns J, O & T the Dates are probably in
columns F, K & P and the rest will follow that pattern across the worksheet.
The macro is easy to change if this is not right.

Now some more questions:-

Please confirm if the above is correct and if not advise accordingly?

What is the name of the worksheet with your data so I can use it in the
macro and you will not have to edit it.

I have named the new worksheet 'Averages'. Is that OK and if not what would
you like to call it?

How conversant are you with macros? Do you need any instructions for copying
it into the workbook and running it etc.

Regards,

OssieMac



"hnyb1" wrote:

OssieMac,

Yes, sorry I wasn't very clear to begin with. You are correct the averages
would be J2:J6, J7:J11 and so on. I would like those averages posted in
another worksheet within the same workbook. I would, however, need that
averaging to repeat every 5 columns, so it would pick back up at O2:O6,
O7:O11 and so on. This will be a continually growing amount of data and I
anticipate it growing to be a great deal of data (In fact I'm worried that
they'll run out of columns before they run out of data, but they are kind of
set on recording the data this way).

As an example (please note, in the interest of conserving space I only have
3 columns between data on the example, but in actuality there are 5)...
SHEET A
Series ID | Date | Study | Output | Date | Study | Output
A 6/1 A1 2.5 6/15 A2 3
B 6/1 B1 3.67 6/15 B2 2.8
C 6/1 C1 3.1 6/15 C2 1.4
D 6/1 D1 2.6 6/15 D2 2.5
E 6/1 E1 2.0 6/15 E2 2.1

I need the code to then calculate the average of those 5 rows in the columns
with the header "Output" and place those averages in Sheet B, i.e...

SHEET B
Date | Average Output | Date | Average Output
6/1 2.774 6/15 2.36

Hope that clarifies. Thanks, in advance for brainstorming this.

Holly


"OssieMac" wrote:

Holly,

Further to my previous post, I have been reading and re-reading your
description and I am sure that I have not really comprehended what you want.
Can you post a sample of what it should look like?

Regards,

OssieMac

"hnyb1" wrote:

I have a spreadsheet of data that will be increasing in number of rows and
number of columns, but within that data starting from cell "J1" I need to
average together the data in every five rows then move over 5 columns and
average together every five rows in that column. This needs to continue
until the column is blank (except for the value in the header in row 1).
Actually, if it helps the columns that I need to identify these averages will
always have the title "Output" in header row.

Any assistance with code would be greatly appreciated!

Thanks,
Holly

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
Getting averages from a column tommy Excel Discussion (Misc queries) 8 August 2nd 08 05:59 AM
macro averages number above and below J-Chef-T Excel Worksheet Functions 4 June 16th 08 09:56 PM
LOOKUP and return the column heading for IF/THEN return for False NN Excel Discussion (Misc queries) 1 October 6th 06 11:24 AM
Column Chart With Averages Displayed David Billigmeier Charts and Charting in Excel 1 March 1st 06 11:18 PM
Macro that counts rows and averages data in row KnightRiderAW Excel Programming 4 December 8th 05 04:09 PM


All times are GMT +1. The time now is 08:28 AM.

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

About Us

"It's about Microsoft Excel"