View Single Post
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Won't work with your other question :-)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"KL" wrote in message
...
sorry - misprint. the first formula should read:

=COUNTIF(A1:A8,"a")+COUNTIF(A1:A8,"b")

KL


"KL" wrote in message
...
Hi John,

For your example (although I think you meant OR not AND) you may do
something like this:

=COUNTIF(A1:A8,"=a")+COUNTIF(A1:A8,"="b")

or

=SUMPRODUCT(--(A1:A8={"a","b"}))

For more complex multiple conditions use SUMPRODUCT(), e.g.

=SUMPRODUCT((A1:A80)*(A1:A8<6)*(A1:A8<100))

Regards,
KL


"johnT" wrote in message
...
can countif criteria be based on 2 or more sets of data??
such as: =COUNTIF(A1:A8,"=AND(a,b)")

thanks......