Reduction of Massive Dataset

jkharmer

Board Regular
Joined
Jul 7, 2008
Messages
77
Hi there,

I have an excel document which has rows and rows of data, however, I want to average the data every 12 rows (the data is taken every 5 seconds and I want to convert it to 60 second averages). Is there any way to write a macro to generate a new column by averaging the 12 data points and then putting it into one uninterrupted column?

Thanks very much, James
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,892
Hi James

You don't need a macro. A Pivot Table will do it automatically, just group the time by minute.

So:

- create a PT. Use your data as source
- right-click on the time, Group->Minutes
- on the data, choose Average
 
Upvote 0

jkharmer

Board Regular
Joined
Jul 7, 2008
Messages
77
Thanks for trying to help, but I do not understand these pivot tables! I have selected the times and data, but it average all of the data - how do I tell it to just average 12 cells, then another 12, then another 12 etc?
 
Upvote 0

Dougie1

Board Regular
Joined
Jul 27, 2007
Messages
212
You will have to ensure that your data column containing the time is formatted as Time.

Then in your Pivot Table > right click anywhere in the Time column > Select Group and Show Detail > Select Group > Select Minutes as your Grouping.

That should do it.
 
Upvote 0

Forum statistics

Threads
1,191,117
Messages
5,984,747
Members
439,907
Latest member
Kayfabe

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top