Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / August 2006

Tip: Looking for answers? Try searching our database.

COUNTIF using OR

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PCLIVE - 17 Aug 2006 18:20 GMT
I'm trying to figure a way to simplify this COUNTIF formula by using the OR
Function.  It works the way it is, but it seems like I should be able to
make it more simple.

=COUNTIF('Week 1'!N$3:N$10000,"CR")+COUNTIF('Week
1'!N$3:N$10000,"ON")+COUNTIF('Week 1'!N$3:N$10000,"CC")+COUNTIF('Week
1'!N$3:N$10000,"OR")

I've tried this with no success.
=COUNTIF('Week 1'!N$3:N$10000,OR("CR","ON","CC","OR"))

 Any ideas?
Bearacade - 17 Aug 2006 18:41 GMT
You pretty much have to do what you are doing.  That's how countif
works..

Signature

Bearacade

Bob Phillips - 17 Aug 2006 19:01 GMT
But you don't have to restrict yourself

=SUMPRODUCT(COUNTIF('Week 1'!N$3:N$10000,{"CR","ON","CC","OR"}))

Signature

HTH

Bob Phillips

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

> You pretty much have to do what you are doing.  That's how countif
> works..
Biff - 17 Aug 2006 18:50 GMT
Hi!

Try this:

=SUMPRODUCT(--(ISNUMBER(MATCH('Week 1'!N3:N10000,{"cr","on","cc","or"},0))))

Biff

> I'm trying to figure a way to simplify this COUNTIF formula by using the
> OR Function.  It works the way it is, but it seems like I should be able
[quoted text clipped - 8 lines]
>
>  Any ideas?
Biff - 17 Aug 2006 18:57 GMT
Another way:

=SUM(COUNTIF('Week 1'!N3:N10000,{"cr","on","cc","or"}))

Biff

> Hi!
>
[quoted text clipped - 17 lines]
>>
>>  Any ideas?
PCLIVE - 17 Aug 2006 20:00 GMT
These have all been good suggestions, some of which worked and others did
not appear to.  However, I have gone with yours, Biff, as it appears to be
the simplist one.

=SUM(COUNTIF('Week 1'!N3:N10000,{"cr","on","cc","or"}))

Thanks to all.
Paul

> Another way:
>
[quoted text clipped - 23 lines]
>>>
>>>  Any ideas?
Dave F - 17 Aug 2006 18:52 GMT
Put OR to the left of the first COUNTIF and separate each COUNTIF with a
comma and enclose the whole thing with parentheses:

=OR(COUNTIF('Week 1'....))

Separate COUNTIFs with commas.

That doesn't really simplify the formula, though, just gives it different
syntax.

> I'm trying to figure a way to simplify this COUNTIF formula by using the OR
> Function.  It works the way it is, but it seems like I should be able to
[quoted text clipped - 8 lines]
>
>   Any ideas?
Sloth - 17 Aug 2006 19:25 GMT
=SUMPRODUCT(--(A1:A10={"CR","ON","CC","OR"}))

should work.  COUNTIF doesn't have a way to include OR.

> I'm trying to figure a way to simplify this COUNTIF formula by using the OR
> Function.  It works the way it is, but it seems like I should be able to
[quoted text clipped - 8 lines]
>
>   Any ideas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.