Nested "CountIf" Function

B

bowierm

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))
 
C

cmart02

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
 
B

Bob Phillips

=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)
 
C

cmart02

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top