Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default looping programing help

I have no idea how to program macros but there has to be an easier way...

I have 100 days of hourly data in one column (c1). I need to find the
average value of r1-24 and put it in c2r1. Then the average value of r25-r48
in c2r2. This need to repeat until all 100 days are done.

I need to summarize the data in many different ways (mean, max, min, etc.)
but figure I can edit the macro to do each when it is done. I would really
appreciate someones help to write a quick macro. thanks in advance.-r
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default looping programing help

I assume that you have 2400 rows of data. 24 rows for each day. Is this
correct?

I also assume from your post that you do not have column headers and the
actual data starts in cell A1.

If above is correct then if the data is in column A then in column B insert
the numbers 1 to 100 in the first 100 rows. (Just insert 1 in the first cell,
2 in the second and 3 in the third row then select the 3 cells and then drag
down and Autofill).

In the cell C1 insert the following formula:-
=AVERAGE(OFFSET($A$1,($B1-1)*24,0):OFFSET($A$1,($B1-1)*24+23,0))

NOTE: If you have column headers and the data starts in in cell A2 then the
1 to 100 will start in B2 and the formula will be as follows:-
=AVERAGE(OFFSET($A$2,($B2-1)*24,0):OFFSET($A$2,($B2-1)*24+23,0))

You can use similar addressing in the adjacent columns D, E etc for MAX,
MIN, MEDIAN etc. Copy and paste the formula and just replace AVERAGE.

If using any other formulas then the 2 offsets simply replace cell reference
ranges in groups of 24. Note the colon (:) between the offsets.

--
Regards,

OssieMac


"russ70" wrote:

I have no idea how to program macros but there has to be an easier way...

I have 100 days of hourly data in one column (c1). I need to find the
average value of r1-24 and put it in c2r1. Then the average value of r25-r48
in c2r2. This need to repeat until all 100 days are done.

I need to summarize the data in many different ways (mean, max, min, etc.)
but figure I can edit the macro to do each when it is done. I would really
appreciate someones help to write a quick macro. thanks in advance.-r

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
Programing Jeremiah Excel Programming 1 October 26th 08 08:50 AM
VBA programing John Excel Programming 2 October 23rd 06 07:24 AM
Programing help jaysphotos Excel Programming 4 December 6th 05 12:15 AM
VB programing Mestrella31 Excel Programming 3 October 11th 04 03:05 PM
Help with VBA programing CyberStorm Excel Programming 3 July 26th 04 07:57 PM


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