CountIfs does not contain failure!

bolomrk1

New Member
Joined
Dec 21, 2011
Messages
14
Sorry Title kind of misleading, should be: CountIfs "does not contain" failure.

Working with CountIfs (not CountIf) and trying to get it to count cells that do not contain certain chars.
Here is a very small subset of the data (currently record subset >100K):

dma1472bssk-cy06-sw03
dma1472bssk-sw03
dma1672bssk8-cy06-sw03
dmp1492bssk3m-cy06-gv16-rs01-sw03
dma1472bssk5c
dma1472bssk5c
dmr1672bssk-btry-cy06-dp01-dr04-jab1-rs01-sw03
dms1672bssk
dms1672bssk
dma1672bssk

The following formula works fine:
=COUNTIFS(Range,"DM*") results being 10
=COUNTIFS(Range,"DM*-sw03*") results being 5

What does NOT work is (trying to exclude any record containing -sw03):
=COUNTIFS(Range,"DM*<>-sw03*") results being 0 not 5
Also tried:
=COUNTIFS(Range,"DM*" & <> & "-sw03*") results being 0
=COUNTIFS(Range,"DM*<>*-sw03*") results being 0
=COUNTIFS(Range,"DM*<>"-sw03*") results being 0
and many other combinations.

If someone could assist me on what it is that I am overlooking it would be greatly appreciated.

Thanks in advance for any assistance you may be able to provide.

LS
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
How about
Excel Formula:
=COUNTIFS(A:A,"dm*",A:A,"<>*-sw03*")
 
Upvote 0
How about
Excel Formula:
=COUNTIFS(A:A,"dm*",A:A,"<>*-sw03*")

Yes, I have gotten that to work, but it will mess up the thousands of formulas already created and cause the modification of spreadsheet by adding another column to hold the modifier (-sw03). I was hoping to avoid that. I hoping there would be a way to get the exclusion formula to work like the inclusion formula works; all from one cell reference.

Thanks Fluff for the quick reply.
 
Upvote 0
There is no way that I know of, for doing it as a single criteria.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,497
Members
448,967
Latest member
visheshkotha

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
Back
Top