Excel QUARTILE函数计算逻辑

从微软网站上找到的关于 Excel 上 QUARTILE() 函数的计算逻辑,与分位值的常规计算方式略有差异,因此记录下来,供需要时参考:

The following is the algorithm used to calculate QUARTILE():

1) Find the kth smallest member in the array of values, where:
k=(quart/4)*(n-1))+1

If k is not an integer, truncate it but store the fractional portion (f) for use in step 3. And where:

  • quart = value between 0 and 4 depending on which quartile you want to find
  • n = number of values in the array

2) Find the smallest data point in the array of values that is greater than the kth smallest – the (k+1)th smallest member.

3) Interpolate between the kth smallest and the (k+1)th smallest values:

Output = a[k]+(f*(a[k+1]-a[k])) a[k] = the kth smallest a[k+1] = the k+1th smallest

Example

To find the third quartile in the array of values 0,2,3,5,6,8,9, follow these steps:

1) Find k and f:

k=TRUNC((3/4*(7-1))+1)=5 f=(3/4*(7-1))-TRUNC(3/4*(7-1))=.5

2) The fifth (kth) smallest value is 6, and the (5+1)th smallest value is 8.

3) Interpolate:

6+(.5*(8-6))=7

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值