COUNTIF isn't counting one of my criteria

AnnasBananas

New Member
Joined
Sep 3, 2020
Messages
5
Office Version
  1. 2013
Platform
  1. Windows
I think I've jumped into the part of Excel where I can't swim. :oops: Thanks in advance for the group's help!!

I'm counting multiple criteria: is it "completed", with this person "cell location", and site includes these letters at the beginning "

=COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,{"PT*";"CF*";"IV*";"DS*";"SR*"})

I have reviewed the data and discovered that it's not counting any of my "CF*" data. Any ideas why it would leave that out of the count?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I have reviewed the data and discovered that it's not counting any of my "CF*" data. Any ideas why it would leave that out of the count?
Welcome to the Board!

Check the "CF" values. Is there a space in front of the "CF" (because as you have written it, it will only return entries where the "CF" occurs in the first two spaces.
Also verify that the "CF" entries meet the other two criteria.

I would start with this, and see if it returns anything:
Excel Formula:
=COUNTIFS($D40:$D1033,"CF*")

If it does, then try adding one of the other conditions in, and test that.
If that works, then try adding in the last condition.
Once that works, add the other values you are looking for in column D.
 
Upvote 0
Hi and welcome to MrExcel
Try this:

=SUM(COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,{"PT*";"CF*";"IV*";"DS*";"SR*"}))
 
Upvote 0
I would start with this, and see if it returns anything:
Excel Formula:
=COUNTIFS($D40:$D1033,"CF*")

If it does, then try adding one of the other conditions in, and test that.
If that works, then try adding in the last condition.
Once that works, add the other values you are looking for in column D.

Progress!...This exercise taught me that only the first of the criteria in the last section is being counted {"PT*";"CF*";"IV*".....}. Only the "PT*" is counted, not the other ones. That leads me to believe that I need to write the formula either with something other than semi-colons, or separate each criteria???
 
Upvote 0
=SUM(COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,{"PT*";"CF*";"IV*";"DS*";"SR*"}))

Thanks for the idea, Donte. Unfortunately, that seemed to return some number that is further from the expected number.
 
Upvote 0
Well, there is probably a better way, but the brute force method should work, regardless:
=COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"PT*")
+COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"CF*")
+COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"IV*")
+COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"DS*")
+COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"SR*")
 
Upvote 0
SUM is the simplest method. If it's not producing the number you expect, then your expectations need revising, or your data does. ;)
 
Upvote 0
Well, there is probably a better way, but the brute force method should work, regardless:
=COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"PT*")
+COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"CF*")
+COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"IV*")
+COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"DS*")
+COUNTIFS($B40:$B1033,"Completed",$F40:$F1033,W4,$D40:$D1033,"SR*")

Yes, I did get that to work. You're right; it's clunky, but functional. I found a link you once posted to a tutorial section on COUNTIFS and OR functions. I found I needed to wrap the whole thing with SUM(...). (Which is what Donte had suggested, but I put his formula into the wrong cell. Eeek!)

Whew! Thank you!
 
Upvote 0
Thanks for the idea, Donte. Unfortunately, that seemed to return some number that is further from the expected number.
Donte, I tried it again because I realized I had put the formula you suggested into the wrong cell (hence the crazy number I got back). It worked!!

What an amazingly clever community! Thanks, Everyone!
 
Upvote 0
SUM is the simplest method. If it's not producing the number you expect, then your expectations need revising, or your data does
Rory is right. I just set up an example and tried Dante's equation, and it returns the expected value. So I don't see any reason why that shouldn't work.

EDIT: Just saw your last post. Glad you figured it out!
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,937
Members
449,094
Latest member
teemeren

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