vba 在 Excel 中提取前 10% 的列值并放入另一列
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13236127/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Extract top 10% of column values in Excel and place in another column
提问by Dora
I have an excel spreadsheets with values in one column. What i need is a VBA code that will identify top 10% of column values, and place them in a adjacent column.
我有一个 Excel 电子表格,其中一列中有值。我需要的是一个 VBA 代码,它可以识别列值的前 10%,并将它们放在相邻的列中。
回答by Totero
Why not ignore VBA and use the percentile function to create a true false column and filter on that.
为什么不忽略 VBA 并使用百分位函数创建一个真假列并对其进行过滤。
EG. Is the Value in B2 in the top 10% of values in Column B?
例如。B2 中的值是否位于 B 列值的前 10%?
=B2>=PERCENTILE($B:$B,0.90)