Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel array countif formula

I want to use COUNTIF function to evaluate how many items out of 2,0,0,5 are greater than 2? In Countif function, first argument is range and second is criteria. I have tried the below formula. Even tried using Ctrl+Shift+Enter at the end to evaluate. But doesn't seem to work.

=COUNTIF({"2","0","0","5"},">2")
like image 442
Surbhi Manocha Avatar asked Jan 29 '23 22:01

Surbhi Manocha


1 Answers

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,""))
like image 125
CallumDA Avatar answered Feb 08 '23 12:02

CallumDA