Countifs formula using CONTAINS

Hi all,

I am currently working on a cross-sheet formula that is trying to determine how many projects are listed as a specific health for a specific person listed in a multi-select drop down. I have been able to determine how to get this formula to work, but only for cells that have one person listed.

=COUNTIFS({Overall Project Health}, "Yellow", {Assigned To}, "Bob Jones")

If there is another person listed in the Assigned To field with Bob, the formula will not count that project. I think I need to add CONTAINS into this formula, but am struggling with how to make it work.

Any help is appreciated.

Thanks,

Andrea

Best Answers

Answers

  • Hi Andrea,

    I struggled with this one as well. Here's what I used and has worked for me:

    =COUNTIFS([Campaign Priority]:[Campaign Priority], CONTAINS("Capital Project", @cell))

    This is looking at a column named Campaign Priority which is set as a multi-select drop down.

    Hope this helps!

    Ally

  • Andrea Mayer
    Andrea Mayer ✭✭✭✭✭

    Hi Ally,

    I am referring to cells in a different sheet so when I reference the other sheet I am using the curly brackets.  I tried your suggestion above but am still receiving and 'INVALID OPERATION' error.

    =COUNTIFS({Overall Project Health}, "Green", {Assigned To}, CONTAINS("Bob Jones"))


    Any other ideas?

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    You are only missing the second portion of the CONTAINS functions.


    =COUNTIFS({Overall Project Health}, "Green", {Assigned To}, CONTAINS("Bob Jones", @cell))

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

  • Andrea Mayer
    Andrea Mayer ✭✭✭✭✭

    Hi Paul - this doesn't give me an error, but I'm not getting the correct answer.  What is the @cell looking at in a cross-sheet reference?  Is it looking at the entire column I am referencing? Thanks!

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    The @cell reference simply tells the formula to evaluate the entire range on a cell by cell basis instead of counting the entire range as a single piece. If you are not getting the correct answer, then you are going to want to re-evaluate your data. Make sure that the entries you think should be counted actually contain "bob space jones" and not "bob space space jones" or other such discrepancies. Extra spaces are not visible when viewing a cell but will become apparent when you enter a cell to edit.


    The bottom cell is a copy/paste of the top cell. It shows where the additional spaces are not shown even though they are there.


    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

  • Andrea Mayer
    Andrea Mayer ✭✭✭✭✭

    Hmm... I am still getting an error: INCORRECT ARGUMENT SET. Any other thoughts?

  • Andrea Mayer
    Andrea Mayer ✭✭✭✭✭
    Answer ✓

    Thank you for the quick response, Paul! After working through this a bit more we have figured it out.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!