Countifs for multiple columns with exclusions
I currently have 3 columns I am using for a chart. I have no problems with the reports because they are based on filters.
Current Filters
Region = All Regions
Business = Business is not one of
Location = Location is not one of
How do i construct a countifs to select all the regions in the column, but exclude one business and one location in the formula. I haven't been able to figure out the syntex.
Best Answer
-
Ok, I didn't know you were using it like this. In this case, just add criteria to each COUNTIFS to exclude that Business name and Location Name:
=COUNTIFS({IT Demand Region}, Region@row, {Business column range}, <> "excluded business name", {Location column range}, <> "excluded location name")
If the business name and/or location name to be excluded changes, you need to use some kind of reference on where to find the ones to exclude. Like say you are presenting this as a report where someone can enter or select the business or location to exclude, then your <> "excluded business name" would change to an exact cell reference, such as <> [Business]1, meaning the first row in the Business column.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
Answers
-
Try this, where badbusiness and badlocation are your excluded values.
=COUNTIFS(Region:Region, <>"", Business:Business, <> "badbusiness", Location:Location, <> "badlocation")
English: Count if Region is not blank, Business is not badbusiness, Location is not badlocation.
By default, COUNT and COUNTIFS will not count blanks, but in order for you to consider multiple criteria, you have to use COUNTIFS, which requires range and criteria, as opposed to just range.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
Maybe I'm approaching how to do this incorrectly.
I created a table listing all the regions in the first column which works perfectly.
Each are referring to a sheet reference I setup. Now I want to add on excluding a variable in the column "Business" and excluding a variable in the column "Location"
Maybe I'm just missing something real obvious.
-
Ok, I didn't know you were using it like this. In this case, just add criteria to each COUNTIFS to exclude that Business name and Location Name:
=COUNTIFS({IT Demand Region}, Region@row, {Business column range}, <> "excluded business name", {Location column range}, <> "excluded location name")
If the business name and/or location name to be excluded changes, you need to use some kind of reference on where to find the ones to exclude. Like say you are presenting this as a report where someone can enter or select the business or location to exclude, then your <> "excluded business name" would change to an exact cell reference, such as <> [Business]1, meaning the first row in the Business column.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
BINGO !!!!!! Thank you !!!!!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.2K Get Help
- 445 Global Discussions
- 143 Industry Talk
- 476 Announcements
- 5K Ideas & Feature Requests
- 84 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!