Formula for totaling 2 selections from a drop down in sheet summary

Hello,I am trying to write a formula for my sheet summary. I would like a formula that gives me a total number when Instructional Design and Learning Solutions is selected. I have been successful with the countif formula when I want to count just one criteria but not two.

Best Answer

  • bisaacs
    bisaacs ✭✭✭✭✭
    Answer ✓

    Hey @KHoward,

    If you're only wanting to count cells that contain both those items, then you'll want to use COUNTIF, AND, CONTAINS in the sheet summary formula:

    =COUNTIF(Dropdown:Dropdown, AND(CONTAINS("Learning Solutions", @cell), CONTAINS("Instructional Design", @cell)))

    If you want to count cells that have either one of them, just change the AND to OR.

    Hope this helps!

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

Answers

  • bisaacs
    bisaacs ✭✭✭✭✭
    Answer ✓

    Hey @KHoward,

    If you're only wanting to count cells that contain both those items, then you'll want to use COUNTIF, AND, CONTAINS in the sheet summary formula:

    =COUNTIF(Dropdown:Dropdown, AND(CONTAINS("Learning Solutions", @cell), CONTAINS("Instructional Design", @cell)))

    If you want to count cells that have either one of them, just change the AND to OR.

    Hope this helps!

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

  • KHoward
    KHoward ✭✭✭

    @bisaacs Thank you, that did the trick. I needed the OR.

  • @bisaacs I was trying to use this formula for my sheet summary formula and it isn't quite working. Will you take a peek please?

    =COUNTIF(CAH STATUS:CAH STATUS, OR CONTAINS("YES READY", @CELL), CONTAINS("YES READY NO SHIELDS DUE TO CREDIT HOLDS", @cell)))

    I get #PUNPARSEABLE error

  • bisaacs
    bisaacs ✭✭✭✭✭

    @Melanie PLU Hey Melanie!

    Looks like you missed a couple things to ensure it works:

    1. Any column names with spaces must have brackets encasing them in a formula: [CAH STATUS]:[CAH STATUS]
    2. When using the OR function, you need to use parenthesis around the different expressions you want to use: OR(CONTAINS(….), CONTAINS(…))
    3. For the 2nd CONTAINS statement, you only should need to put "NO SHIELDS DUE TO CREDIT HOLDS", since the first contains already is accounting for "YES READY"

    Hope this helps!!

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

  • bisaacs
    bisaacs ✭✭✭✭✭
    edited 12/18/24

    So sorry, I forgot to include the formula that worked for me @Melanie PLU:

    =COUNTIF([CAH STATUS]:[CAH STATUS], OR(CONTAINS("YES READY", @cell), CONTAINS("NO SHIELDS DUE TO CREDIT HOLDS", @cell)))

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!