首页 > 解决方案 > 评估频率公式的中间步骤

问题描述

这参考了 [SO question]根据其他范围的标准计算范围中的唯一项目列表 Scot Craner 建议的公式是:

=SUM(--(FREQUENCY(IF(B2:B7<=25,IF(C2:C7<=35,COUNTIF(A2:A7,"<"&A2:A7),""),""),COUNTIF(A2:A7,"<"&A2:A7))>0))

除了所附快照中显示的这一步外,我已经能够清楚地理解公式的逻辑和评估。根据 MS Office 文件:

FREQUENCY(data_array, bins_array) FREQUENCY 函数语法具有以下参数: Data_array 必需。要计算频率的一组值的数组或引用。如果 data_array 不包含任何值,则 FREQUENCY 返回一个零数组。Bins_array 必需。要将 data_array 中的值分组到其中的区间数组或引用。如果 bins_array 不包含任何值,则 FREQUENCY 返回 data_array 中的元素数。

我很清楚 {1;1;4;0;"";"") 如何进入 data_array 以及 {1;1;4;0;5;3} 如何进入 bins_array。但它如何评估到 {2;0;1;1;0;0;0} 我不清楚。如果有人能清楚地解释它,将不胜感激。

评估阶段a评估阶段b

标签: excelexcel-formula

解决方案


所以你想知道如何

FREQUENCY({1;1;4;0;"";""},{1;1;4;0;5;3})评估为{2;0;1;1;0;0;0}?

问题是bins_array不需要排序才能FREQUENCY正常工作。但当然,它必须在内部对 进行排序bins_array以获取将 中的值分组到的区间data_array。然后它分组和计数,然后以与 bin 中给出的相同顺序返回计数的数字 bins_array

Scores   Bins 
1        1
1        1
4        4
0        0
""       5
""       3

Bins sorted
0 (<=0)
1 (>0, <=1)
1 (>1, <=1) == not possible
3 (>1, <=3)
4 (>3, <=4)
5 (>4, <=5)
(>5)

Bin    Description                                     Result
1      Number of scores (>0, <=1)                      2
1      Number of scores (>1, <=1) == not possible      0
4      Number of scores (>3, <=4)                      1
0      Number of scores (<=0)                          1
5      Number of scores (>4, <=5)                      0
3      Number of scores (>1, <=3)                      0
       Number of scores (>5)                           0

推荐阅读