对于列中的每个单元格,我需要获取列中的单元格数量,该数量在该单元格的值和值+ 10的范围内。我尝试了COUNtIF
Let's say this is the column:
11 -> how many cells between 11 and 20
23 -> how many cells between 34 and 43
17 -> how many cells between 17 and 27
13
26
对此进行了尝试,但仅显示零:
=COUNTIFS(B:B; ">=B2"; B:B; "<B2+10")
答案 0 :(得分:1)
您将字符串连接分组错误。
=COUNTIFS(B:B; ">="&B2; B:B; "<"&B2+10)
数字文字(例如10)可以包含在运算符中,也可以不包含在带引号的字符串中,但是单元格地址不能包含在字符串中,并且必须与带引号的运算符一起串联。
..., ">=11") 'this is OK
..., ">="&11) 'this is OK
..., ">="&B2) 'this is OK
..., ">=B2") 'this is NOT OK