Countif

  • Thread starter Thread starter Khalil handal
  • Start date Start date
K

Khalil handal

Hi,
Cell C12 has this formula: COUNTIF($E12:$AI12,$C$5)
What modifications should be done so as it will count the values equal to C4
(in addition to C5).
Khalil
 
=SUMPRODUCT(SIGN(($E$12:$AI$12=$C$4)+($E$12:$AI$12=$C$5)))

or if contiguous then

=SUMPRODUCT(--(($E$12:$AI$12=$C$4:$C$5)))

or

=SUMPRODUCT(--ISNUMBER(MATCH($E$12:$AI$12,$C$4:$C$5,0)))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Hi,
Cell C12 has this formula: COUNTIF($E12:$AI12,$C$5)
What modifications should be done so as it will count the values equal to C4
(in addition to C5).
Khalil

=COUNTIF($E12:$AI12, OR($C$5, $C$4))

Using the OR function will allow you to count multiple criteria.

HTH,
Matt Richardson
http://teachr.blogspot.com
 
May I suggest that you actually try your suggestion here, and your other
one.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
May I suggest that you actually try your suggestion here, and your other
one.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Ignore my response earlier! I've answered two questions this morning
about COUNTIFs and both were wrong. My head's just not screwed on
right today LOL.

Theres a couple of other ways of doing this here:-

http://www.ozgrid.com/Excel/count-if.htm

Regards,
Matt Richardson
http://teachr.blogspot.com
 
Hi,
thank you very much. It was perfect.

Khalil

Bob Phillips said:
=SUMPRODUCT(SIGN(($E$12:$AI$12=$C$4)+($E$12:$AI$12=$C$5)))

or if contiguous then

=SUMPRODUCT(--(($E$12:$AI$12=$C$4:$C$5)))

or

=SUMPRODUCT(--ISNUMBER(MATCH($E$12:$AI$12,$C$4:$C$5,0)))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)
 
And, just in case you might like to use Countif(), try this:

=SUM(COUNTIF($E12:$AI12,N(INDIRECT({"C4","C5"}))))
 

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

Back
Top