COUNTIF quiestion

D

digitallifeform

Wondering if you could help, I am automating sales stats at the moment,
and am currently using:

=COUNTIF(N1:N500,"SJP")

Which works fine, however the field I am asking it to search can be one
of two things, the "SJP" or "SJP/MBL" and I need it to check for both,
I have tried:

=COUNTIF(N1:N500,"SJP""SJP/MBL")
=COUNTIF(N1:N500,"SJP","SJP/MBL")

Which both don't work - how do I get it to do an 'or' function?

Any help would be appreciated.

Thanks
 
R

Ron Rosenfeld

=COUNTIF(N1:N500,"*SJP*")

aLAN bEBAN

That works so long as if the field contains SJP, it will only contain either
SJP or SJP/MBL. However, if there are other SJP containing fields, than the
formula fails.


--ron
 
A

Alan Beban

The OP said:

the field I am asking it to search can be one
of two things, the "SJP" or "SJP/MBL"

Alan Beban
 
H

Harald Staff

=COUNTIF(N1:N500,"*SJP*")
The OP said:
the field I am asking it to search can be one
of two things, the "SJP" or "SJP/MBL"

If those two are the only values present, why COUNTIF at all ??? <bg>
Best wishes Harald
 
R

Ron Rosenfeld

The OP said:

the field I am asking it to search can be one
of two things, the "SJP" or "SJP/MBL"


Well then, if that's all it could be:
=COUNT(N1:N500)

would be even simpler.


--ron
 
R

Ron Rosenfeld

The OP said:

the field I am asking it to search can be one
of two things, the "SJP" or "SJP/MBL"

Well, simpler would be:
=COUNT(N1:N500)
=ROW(N500)
=500

<g>


--ron
 
B

Bosco

The OP Said : the field I am asking it to search can be one
Try the following formula in meet with the 2 conditions :

=SUM(COUNTIF(N1:N500,{"SJP","SJP/MBL"}))


Regards
Bosco
 

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