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
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(quot;Bquot; amp; Rows.Count).End(xlUp).Offset(1)
Loop Until Application.CountA(ActiveCell.Offset(c).Resize(3)) = 0
End Sub
quot;Arvin Lab Ratquot; lt;Arvin Lab gt; wrote in message
...
gt;I have large columns of data (4000 to 5000 entrys) I would like to thin
gt;the
gt; data out or reduce the number of samples by building a new column of
gt; groups
gt; of average values. For example:
gt; 3 reduce by average groups of 3 3
gt; 3 5
gt; 3 7
gt; 4
gt; 5
gt; 6
gt; 7
gt; 7
gt; 7
gt; If any one can offer some advise
gt; Thanks in advance
Thanks I can't wait to try it.
quot;Otto Moehrbachquot; wrote:
gt; The following macro does what you want. As written, the column of data is
gt; Column A starting in A1 and the averages are placed in Column B starting in
gt; B1. Nothing is done to the data in Column A. HTH Otto
gt; Sub ThinOut()
gt; Dim c As Long
gt; Dim Dest As Range
gt; Set Dest = [B1]
gt; c = 0
gt; [A1].Select
gt; Do
gt; Dest.Value = Application.Average(ActiveCell.Offset(c).Resize(3) )
gt; c = c 3
gt; Set Dest = Range(quot;Bquot; amp; Rows.Count).End(xlUp).Offset(1)
gt; Loop Until Application.CountA(ActiveCell.Offset(c).Resize(3)) = 0
gt; End Sub
gt; quot;Arvin Lab Ratquot; lt;Arvin Lab gt; wrote in message
gt; ...
gt; gt;I have large columns of data (4000 to 5000 entrys) I would like to thin
gt; gt;the
gt; gt; data out or reduce the number of samples by building a new column of
gt; gt; groups
gt; gt; of average values. For example:
gt; gt; 3 reduce by average groups of 3 3
gt; gt; 3 5
gt; gt; 3 7
gt; gt; 4
gt; gt; 5
gt; gt; 6
gt; gt; 7
gt; gt; 7
gt; gt; 7
gt; gt; If any one can offer some advise
gt; gt; Thanks in advance
gt;
gt;
gt;
I tried the macro and it works great!!!!!
Thanks for your help!!
- Apr 21 Sat 2007 20:37
thin # of samples by averaging
close
全站熱搜
留言列表
發表留言