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

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    edited 01/18/22 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

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    edited 01/18/22

    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!

  • Jacque Hale
    Jacque Hale ✭✭✭

    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.

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    edited 01/18/22 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!

  • Jacque Hale
    Jacque Hale ✭✭✭

    BINGO !!!!!! Thank you !!!!!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!