Macro help to average 3 cells in a column, then go to next column and repeat

amandabstewart

New Member
Joined
Aug 4, 2014
Messages
45
I need some help doing a specific set of averages in columns and repeating that--I'm guessing in a For Next loop?

Data is arranged as shown, but this is just some of the data...spreadsheet is both wider and longer.
I've written a separate tiny macro to auto insert a gap after every 3 readings.

What I need now is a macro to average (like the 0.849 in bold) but to repeat that for every cage column. The time column doesn't matter--there is nothing associated with the average that will be used, but I'd like to leave that column there if I can. It can be deleted if that's easier though. I do need to leave the interval # column.

So, I want the macro to essentially copy/paste the equation to average the 3 values, then go to the next cage value, and average that, and continue thru the workbook until it has averaged them all.
Any help is greatly appreciated!!!!!
And, if anyone is curious, the measurements you see are the energy expenditure of individual mice that we determine by measuring how much O2 a mouse uses and how much CO2 it exhales. YUP--we can measure those tiny amounts! Research is related to the study of diabetes : ) and the mice are super well cared for!
thanks,
Amanda

=======================================================================================================================================
INTERVALTIMECAGE 0101TIMECAGE 0102TIMECAGE 0103TIMECAGE 0104
=======================================================================================================================================
1​
11/3/2022 10:36​
0.8693227​
11/3/2022 10:38​
0.8181364​
11/3/2022 10:40​
0.8848163​
11/3/2022 10:42​
0.9267077​
2​
11/3/2022 11:02​
0.8788034​
11/3/2022 11:04​
0.8447641​
11/3/2022 11:06​
0.9146467​
11/3/2022 11:08​
0.9503243​
3​
11/3/2022 11:28​
0.8015884​
11/3/2022 11:30​
0.7639491​
11/3/2022 11:32​
0.7099572​
11/3/2022 11:34​
0.81789​
0.849904833
4​
11/3/2022 11:54​
0.7518336​
11/3/2022 11:56​
0.6826341​
11/3/2022 11:58​
0.783646​
11/3/2022 12:00​
0.7855486​
5​
11/3/2022 12:20​
0.8345104​
11/3/2022 12:22​
0.7100649​
11/3/2022 12:24​
0.8369074​
11/3/2022 12:26​
0.8929983​
6​
11/3/2022 12:46​
0.8329283​
11/3/2022 12:48​
0.8698398​
11/3/2022 12:50​
0.8942238​
11/3/2022 12:52​
0.8935511​
7​
11/3/2022 13:12​
0.8153725​
11/3/2022 13:14​
0.7927898​
11/3/2022 13:16​
0.8651289​
11/3/2022 13:18​
0.8778515​
8​
11/3/2022 13:38​
0.7405694​
11/3/2022 13:40​
0.8564663​
11/3/2022 13:42​
0.7961046​
11/3/2022 13:44​
0.8044844​
9​
11/3/2022 14:04​
0.7546856​
11/3/2022 14:06​
0.819183​
11/3/2022 14:08​
0.8098394​
11/3/2022 14:10​
0.9363939​
10​
11/3/2022 14:30​
0.7818038​
11/3/2022 14:32​
0.9276255​
11/3/2022 14:34​
0.8257115​
11/3/2022 14:36​
0.8838142​
11​
11/3/2022 14:56​
0.7572582​
11/3/2022 14:58​
0.9787874​
11/3/2022 15:00​
0.8374528​
11/3/2022 15:02​
0.8844657​
12​
11/3/2022 15:22​
0.8172265​
11/3/2022 15:24​
1.020203​
11/3/2022 15:26​
0.8203239​
11/3/2022 15:28​
0.9175188​
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I needed to add that the data will always range from A to Y but will be of variable length.
I know that

Sub average3()
Range("C8").Copy Destination:=Range("E8, G8, I8, K8, M8, O8, Q8, S8, U8, W8, Y8")
End Sub

will work if I have the equation to average in cell C8 and that it will then copy to the other cells in that row...
so, how best to have it select the next empty row (row 12, between iterations 6 and 7) and copy the row above to the next empty rows? when I tried to do this on my own, no bueno :(
 
Upvote 0

Forum statistics

Threads
1,224,753
Messages
6,180,748
Members
452,996
Latest member
nelsonsix66

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
Back
Top