I have a column that lists bunch of numbers. How can I select the average of top 30% of the values in one column:
我有一個列出一堆數字的專欄。如何在一列中選擇前30%值的平均值:
'Values'
10
9
8
7
6
5
4
3
2
1
so, the top 30% is '10, 9, 8' and the average is (10+9+8)/3 = 9
所以,前30%是'10,9,8',平均值是(10 + 9 + 8)/ 3 = 9
6
In any version of excel you can use either a SUMIF/COUNTIF along the same lines as Sean's suggestion, i.e.
在任何版本的Excel中,您可以使用與Sean的建議相同的SUMIF / COUNTIF,即
=SUMIF(A1:A10,">"&PERCENTILE(A1:A10,0.7))/COUNTIF(A1:A10,">"&PERCENTILE(A1:A10,0.7))
or a shorter "array formula"
或更短的“數組公式”
=AVERAGE(IF(A1:A10>PERCENTILE(A1:A10,0.7),A1:A10))
confirmed with CTRL+SHIFT+ENTER
用CTRL + SHIFT + ENTER確認
These should all give identical results
這些都應該給出相同的結果
5
If you are using excel 2007 or newer, =AVERAGEIF(A2:A10,">"&PERCENTILE(A2:A10,0.7))
如果您使用的是excel 2007或更新,= AVERAGEIF(A2:A10,“>”和PERCENTILE(A2:A10,0.7))
1
Without using VBA:
不使用VBA:
Putting data into column A.
將數據放入A列。
Create this intermediate column B:
創建此中間列B:
B1=IF(RANK(A1,$A$1:$A$10)<=30*COUNT($A$1:$A$10)/(100), A1,0)
B2=IF(RANK(A2, ...
Then Average this column with:
然后將此列平均為:
=AVERAGEIF(B1:B10,">0")
For your given example you get 9.
對於你給出的例子,你得到9。
0
You could also do this without formulas by including a column title and choosing:
你也可以在沒有公式的情況下通過包含列標題並選擇:
Data > Filter > Number Filter > Top 10...(Top 30 Percent)
數據>過濾器>數字過濾器>前10名...(前30%)
Highlight the column to see sum, average, count, max. (Right-click the status bar and select "average" if not displayed.)
突出顯示列以查看總和,平均值,計數,最大值。 (如果未顯示,請右鍵單擊狀態欄並選擇“平均值”。)
If you want the result of the filtered average in a cell you can use =SUBTOTAL(1,A2:A11)
如果你想在單元格中得到過濾平均值的結果,你可以使用= SUBTOTAL(1,A2:A11)
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2012/06/01/72570c2d2ded49138d7c370986a7e9a4.html。