How to Count a Multiselect

Options

Hi,

How to count a multi-select. I have the count for Columbus and Cleveland. How do I count the ones that are selected Cleveland Columbus.

Tags:

Answers

  • mcullen
    mcullen ✭✭✭
    edited 06/26/24
    Options

    Hello Jett!

    You could try adding Sheet Summary fields with the following formulas

    =COUNTIFS(Location/Type:Location/Type, HAS(@cell, "Cleveland"))

    =COUNTIFS(Location/Type:Location/Type, HAS(@cell, "Columbus"))

    Michelle Cullen

  • Nic Larsen
    Nic Larsen ✭✭✭✭✭✭
    Options

    If you are trying to get a total count of the rows that have Cleveland even when Columbus is also selected, you'd use something like this:

    =COUNTIFS([Location/Type:Location/Type], HAS(@cell, "Cleveland")

  • Jett
    Jett ✭✭✭
    Options

    The first formula is giving me the result of 0 and then the second one is giving me 41 when the answer should be 6.

  • Nic Larsen
    Nic Larsen ✭✭✭✭✭✭
    edited 06/26/24
    Options

    Ahh you want a formula to count for both conditions:

    =COUNTIFS([Location/Type:Location/Type], AND(CONTAINS("Cleveland", @cell), CONTAINS("Columbus", @cell)

    Revised a bit. Try it this way.

  • mcullen
    mcullen ✭✭✭
    Options

    Do you want a count for how many rows have both Columbus and Cleveland?

    Michelle Cullen

  • Jett
    Jett ✭✭✭
    Options

    Hi, That is very close it is counting them but It is also doing the one that has 3 How do I make it count the one that only has Cleveland and Columbus. Then one that will count the all 3.

  • Nic Larsen
    Nic Larsen ✭✭✭✭✭✭
    edited 06/26/24
    Options

    Try:

    =COUNTIFS([Location/Type:Location/Type], AND(CONTAINS("Cleveland", @cell), CONTAINS("Columbus", @cell), NOT(CONTAINS("Re-Rent", @cell)

    =COUNTIFS([Location/Type:Location/Type], AND(CONTAINS("Cleveland", @cell), CONTAINS("Columbus", @cell), CONTAINS("Re-Rent", @cell)

  • Jett
    Jett ✭✭✭
    Options

    Thank you so much that worked.

    Do you know a formula that will display the custom name entered on each Line and then will display the certain ones for Cleveland and then Display the other names for Columbus. I am creating a dashboard and trying to have the certain items displayed in a graph for each location.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!