Sun IF two data types are the same in a single column

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

Guest

Am sure their is an easy answer to this !! But am trying to count the number
of times the letter Q and S appear in the samE column.

The formulae to count Q which works is as below :-

{=SUM(IF(H$7:H$1300 = "Q",1,0))}

What I would like to write for Q and S is :-

{=SUM(IF(H$7:H$1300 = "Q" or "S",1,0))}

But it does not work !!!!!!!!!

Would really appreciate any help on this,
Thanks,
David.
 
If you are counting the number of cells that contain either "Q" or "S", try
this:

=SUM(COUNTIF(H$7:H$1300,{"q","s"}))

Note: COUNTIF is NOT case sensitive

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
=sum(countif(H$7:H$1000="Q"),countif(H$7:H$1000)="S")

This just counts the number of Q's and S's in the range and sums those two
values together. Should work for you.

Dave
 
BTW, if you do want to use an array formula, something like this would
address your "or" condition:

{=SUM(IF(OR(H$7:H$1300="Q",H$7:H$1300="S",1,0))}

Dave
 
=SUMPRODUCT(--(ISNUMBER(MATCH(H$7:H$1300,{"Q","S"},0))))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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