ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   program for filtering data. (https://www.excelbanter.com/excel-programming/291395-program-filtering-data.html)

dilsenahin

program for filtering data.
 
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

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

program for filtering data.
 
'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:
(daat average+divation AND data <
average + diviation)


--
Regards,
Tom Ogilvy

dilsenahin wrote in message
...
Hi,

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

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

hope you understand what i want to do.

dilse.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 11:37 AM.

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