Nested "CountIf" Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to do a nested (double) countif function? Trying to count
lines of data based on two separate critera, such as
countif(a2:a5000,"1",+countif(b2:b5000>0))
 
Bow,

You can as follows:

=SUM(COUNTIF(Interval;{1,2}))

Presso CTRL+SHIFT+ENTER after typing the last parentheses. The numbers
between curly-brackets represent the array-constant that you wish to count.
In this case, I am counting the number 1 and 2 in the interval selected.

Regards,
Robert
 
=SUMPRODUCT(--(A2:A5000=1),--(B2:B5000>0))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Bow,

Just a minor correction, change the ";" in the formula for ",". My system
uses "," as decimal separator and I forgot to change in my previous answer:

=SUM(COUNTIF(Interval,{1,2}))

Regards,
Robert
 
Back
Top