excel - 频率公式评估的中间步骤

标签 excel excel-formula

这引用了[SO问题]Counting unique list of items from range based on criteria from other ranges 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) The FREQUENCY function syntax has the following arguments: Data_array Required. An array of or reference to a set of values for which you want to count frequencies. If data_array contains no values, FREQUENCY returns an array of zeros. Bins_array Required. An array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.

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

evaluation stage a evaluation stage b

最佳答案

所以你想知道如何

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 中的值分组到的间隔。然后它进行分组和计数,然后按照 bins_array 中给出的 bin 的相同顺序返回计数的数字。

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

关于excel - 频率公式评估的中间步骤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54050483/

相关文章:

excel - 使用 VBA Excel 在两个不同的单元格中添加/减去日期更改

excel - 计算筛选工作表中的可见行数

excel - 使用 MSBuild 更改 .xla 文件

sql - 将 Excel 电子表格导入 Access - [h] :mm:ss 的格式问题

excel - excel中如何保持一个变量不变而另一个变量随行变化

excel - 找出较长期间内较短的天数进行计算

c# - 按条件读取 Excel 文件

excel - 如何从列分隔的数据集转换为逗号分隔的数据集?

excel-formula - 如何在连接 Excel 中的单元格时忽略空白单元格

excel - 2 个标准的总和