Countif multiple criteria

Michael Joiner

New Member
Joined
Aug 17, 2010
Messages
2
I've tried some different countif formulas and array formulas, without success. I need a formula that says COUNTIF A2:A399 is NOT equal to "DETROIT" and is NOT equal to "PHILADELPHIA". Please help.
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

delaneyjm

Well-known Member
Joined
Apr 22, 2009
Messages
624
Try:

=SUMPRODUCT(--($A$2:$A$399 <> "DETROIT"),--($A$2:$A$399 <> "PHILADELPHIA"))
 

sulakvea

Well-known Member
Joined
Jul 2, 2008
Messages
994
simproduct is one option, but you can stick to countif only:

=398 - countif(A2:A399,"<>DETROID")-countif(A2:A399,"<>PHILLY")
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,350
Cant you just use COUNTIFS?

=COUNTIFS(A2:A399,"<>DETROIT",A2:A399,"<>PHILADELPHIA")
 

EB08

Active Member
Joined
Jun 9, 2008
Messages
343

ADVERTISEMENT

It depends on which version of excel Michael is using; i don't believe 'Countifs' was introduced until the 07 version of excel. If he's on 03, then the first response (sumproduct()) is the way i would go.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
I've tried some different countif formulas and array formulas, without success. I need a formula that says COUNTIF A2:A399 is NOT equal to "DETROIT" and is NOT equal to "PHILADELPHIA". Please help.

Just enter:

=COUNTIF(A2:A399,"?*")-SUM(COUNTIF(A2:A399,{"DETROIT","PHILADELPHIA"}))
 

delaneyjm

Well-known Member
Joined
Apr 22, 2009
Messages
624

ADVERTISEMENT

Oh man, that's one quick formula Aladin.
 

Michael Joiner

New Member
Joined
Aug 17, 2010
Messages
2
Thank you very much for both examples (SUMPRODUCT, and COUNTIFS). I have 2003 at home and 2007 at work, so both are valuable. Mr Excel is my new BFF!
 

Watch MrExcel Video

Forum statistics

Threads
1,123,304
Messages
5,600,864
Members
414,409
Latest member
FloordAlex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top