Macro for SUM and AVE of data in every 6th row

1. Macro for SUM and AVE of data in every 6th row

Hello Forum:

I have a extensive table of weather data that has been collected every 10 minutes. In other words, each row has a data point of precipitation, wind speed and wind gust speed for every 10 minute interval. I would like to find the total precipitation for each hour (column E), and the mean wind speed (column F) and gust speed (column G) for that hour. Seems like its would be a simple matter of selecting every 6th row, and calculating the sum or average for the appropriate column for that row and the preceding five row, then looping through to repeat for the data six rows below, etc. etc. If useful, I have separate columns for the reading number (sequential, 1 - 4303; column A), date 144 rows for each date; column B), time (in HH:MM format, 24-hour clock; column C), and the unique numeric date/time value (e.g. 40844.3333 = 10/28/2011 at 08:00; column D).

Hopefully, this explanation makes sense.

Thanks for any help anyone can offer ...

La French

2. Re: Macro for SUM and AVE of data in every 6th row

Hi

Can you please add an example file, with sufficient data to get a good appreciation of your situation, and expected output from sample data.

rylo

3. Re: Macro for SUM and AVE of data in every 6th row

Try This,

``Please Login or Register  to view this content.``
The other format stuff , if you can do what rylo suggested it would great

4. Re: Macro for SUM and AVE of data in every 6th row

Thanks for the answers thus far ...

I have attached a bit of the raw data file. The no-fill columns (A-H) are the actual raw data, while the blue columns (I-K) are the results of manual sum / ave calculations for each hourly period - the results I'd like to automate.

JapanDave ... when I try and run the macro you wrote, I receive a "Subscript Out of Range" error in VBE.

Thanks again ...

5. Re: Macro for SUM and AVE of data in every 6th row

You need to assign the sheet name to the code. But it looks like you need a row added anyway.

There are currently 1 users browsing this thread. (0 members and 1 guests)