Excel array countif formula

♀尐吖头ヾ 提交于 2019-12-05 22:01:11
CallumDA

COUNTIF doesn't accept array constants (as far as I know). Try this:

=SUMPRODUCT(--({2,0,0,5}>2))

You could also create a countif-style formula like this (the combination ctrl+shift+enter):

=COUNT(IF({2,0,0,5}>2,1,""))

Recommended reading: Array vs Range

Some functions like Offset, SumIf, CountIf, SumIfs, and CountIfs are designed to operate only on (multi-cell) range objects. Sum, SumProduct, Frequency, Linest, lookup functions, etc. take both range and array objects.

Array means: {2,0,0,5}

Range means:

To use countif, you have to use range in cells, defining the array in the formula on the go will not work.

=COUNTIF(A1:A4,">"&2)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!