program for filtering data.

  • Thread starter Thread starter dilsenahin
  • Start date Start date
D

dilsenahin

Hi,

i want to write some code that will do the following.

if i select some numerical data in the excel column, the program shoul
find out the average and standard deviation of the selected data. the
it should put "0" in the column if (daat > average+divation AND data
average + diviation) otherwise it should keep the original data. it i
not necessary to see the standard deviation.

hope you understand what i want to do.

dilse
 
'set rng = Range(cells(1,1),Cells(1,1).End(xldown)

set rng = Selection
ave = Application.Average(rng)
stdev = Application.Stdev(rng)
for each cell in rng
if cell.Value > ave+stdev or cell.value < cell-stdev then
cell.Value = 0
end if
Next


or if you want to change the values within 1 std dev

If cell.value < ave + stdev and cell.Value > ave - stdev then

Your stated criteria doesn't make any sense:
 
Back
Top