ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   thin # of samples by averaging (https://www.excelbanter.com/excel-worksheet-functions/84503-thin-samples-averaging.html)

Arvin Lab Rat

thin # of samples by averaging
 
I have large columns of data (4000 to 5000 entrys) I would like to thin the
data out or reduce the number of samples by building a new column of groups
of average values. For example:
3 reduce by average groups of 3 3
3 5
3 7
4
5
6
7
7
7
If any one can offer some advise
Thanks in advance

Otto Moehrbach

thin # of samples by averaging
 
The following macro does what you want. As written, the column of data is
Column A starting in A1 and the averages are placed in Column B starting in
B1. Nothing is done to the data in Column A. HTH Otto
Sub ThinOut()
Dim c As Long
Dim Dest As Range
Set Dest = [B1]
c = 0
[A1].Select
Do
Dest.Value = Application.Average(ActiveCell.Offset(c).Resize(3) )
c = c + 3
Set Dest = Range("B" & Rows.Count).End(xlUp).Offset(1)
Loop Until Application.CountA(ActiveCell.Offset(c).Resize(3)) = 0
End Sub
"Arvin Lab Rat" <Arvin Lab wrote in message
...
I have large columns of data (4000 to 5000 entrys) I would like to thin
the
data out or reduce the number of samples by building a new column of
groups
of average values. For example:
3 reduce by average groups of 3 3
3 5
3 7
4
5
6
7
7
7
If any one can offer some advise
Thanks in advance




Arvin Lab Rat

thin # of samples by averaging
 
Thanks I can't wait to try it.

"Otto Moehrbach" wrote:

The following macro does what you want. As written, the column of data is
Column A starting in A1 and the averages are placed in Column B starting in
B1. Nothing is done to the data in Column A. HTH Otto
Sub ThinOut()
Dim c As Long
Dim Dest As Range
Set Dest = [B1]
c = 0
[A1].Select
Do
Dest.Value = Application.Average(ActiveCell.Offset(c).Resize(3) )
c = c + 3
Set Dest = Range("B" & Rows.Count).End(xlUp).Offset(1)
Loop Until Application.CountA(ActiveCell.Offset(c).Resize(3)) = 0
End Sub
"Arvin Lab Rat" <Arvin Lab wrote in message
...
I have large columns of data (4000 to 5000 entrys) I would like to thin
the
data out or reduce the number of samples by building a new column of
groups
of average values. For example:
3 reduce by average groups of 3 3
3 5
3 7
4
5
6
7
7
7
If any one can offer some advise
Thanks in advance





Arvin Lab Rat

thin # of samples by averaging
 
I tried the macro and it works great!!!!!
Thanks for your help!!




All times are GMT +1. The time now is 05:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com