Excluding Criteria in a COUNTIFS formula in Excel

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
291
Office Version
  1. 365
Platform
  1. Windows
I have this simple formula:

=COUNTIFS('Emp List'!C2:C16,B2,'Emp List'!B2:B16,C2,'Emp List'!E2:E16,D2,'Emp List'!F2:F16,E2)

However, if any of the criteria in B2, C2, D2 or E2 equals "Overall", I want to ignore that criteria range and criteria. For example, if cell C2 = "Overall", then the formula would in essence calculate as follows:

=COUNTIFS('Emp List'!C2:C16,B2,'Emp List'!E2:E16,D2,'Emp List'!F2:F16,E2)

That could happen with any combination of criteria.

Is there a simple way to accomplish this?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Are the values you are counting text or numbers?
 
Upvote 0
Ok, you can do that like
Excel Formula:
=COUNTIFS('Emp List'!C2:C16,IF(B2="","*",B2),'Emp List'!B2:B16,IF(C2="","*",C2),'Emp List'!E2:E16,D2,'Emp List'!F2:F16,E2)
Just repeat what I've done for B2 & C2 for the others.
 
Upvote 0
Solution
Ok, you can do that like
Excel Formula:
=COUNTIFS('Emp List'!C2:C16,IF(B2="","*",B2),'Emp List'!B2:B16,IF(C2="","*",C2),'Emp List'!E2:E16,D2,'Emp List'!F2:F16,E2)
Just repeat what I've done for B2 & C2 for the others.
That did it, thanks! I didn't think about using a wild card!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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