简体   繁体   English

如何在Excel中计算百分位数?

[英]how to calculate percentile in Excel?

I have a row of numbers, and I want below each number to have the percentile of that number (compared to the other numbers in the row). 我有一排数字,并且我希望每个数字下方都有该数字的百分位数(与该行中的其他数字相比)。 I tried to use =RANK.EQ but that didn't quite work. 我尝试使用= RANK.EQ,但是效果不佳。 (since I think I can only use a range over a column instead of a row?) (因为我认为我只能在列而不是行上使用范围?)

EDIT: I am looking to map a number x to p(x) where p(x) is the percentage of y's that fall below x in that row. 编辑:我正在寻找将一个数字x映射到p(x),其中p(x)是该行中低于x的y的百分比。

Assumed all your data is in column A then you can get the percentile of A1 with =A1/SUM(A:A) 假设所有数据都在A列中,则可以使用=A1/SUM(A:A)获得A1的百分位数

Same can be done for Rows by replacing A:A with the given Row number of the values, for example 2:2 通过用给定值的行号替换A:A ,可以对Rows执行相同的操作,例如2:2

Let row 1 be your numbers (A1:Z1). 假设第1行是您的数字(A1:Z1)。 For A2, use =Percentrank($A1:$Z1,A1). 对于A2,请使用= Percentrank($ A1:$ Z1,A1)。 Drag formula. 拖动公式。

I'm not sure about the y s but for: 我不确定y但适用于:

the percentage of y's that fall below x in that row 在该行中低于x的y的百分比

suggest in A2 and copied across to suit: 在A2中建议并复制以适合:

=1-RANK(A1,$A1:$Z1)/COUNT($A1:$Z1)  

where the row with x s is assumed to be Row1 and the row length ColumnsA:Z. 其中x s的行假定为Row1,行长度为ColumnsA:Z。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM