thin # of samples by averaging

A

Arvin Lab Rat

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
 
O

Otto Moehrbach

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
 
A

Arvin Lab Rat

Thanks I can't wait to try it.

Otto Moehrbach said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top