Count the number of times multiple values appear in a column

Hello SS Community,


I'm trying to count the number of instances two values appear together in a cell. From the following example, I would like to count how often "Contractor" and "Vendor" appear together, and furthermore I would like to sum the budget for those instances as well.


When I use the CountIf with Contains formula, it is giving me every instance the contractor appears in the column. Is there any way to achieve the given objective here?


Thank you,


Yogin


Best Answer

Answers

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭

    Hi Yogin,

    Try something like this.

    =COUNTIFS(Dept:Dept; CONTAINS("Contractor"; @cell); Dept:Dept; CONTAINS("Vendor"; @cell))
    

    The same version but with the below changes for your and others convenience.

    =COUNTIFS(Dept:Dept, CONTAINS("Contractor", @cell), Dept:Dept, CONTAINS("Vendor", @cell))
    

    Depending on your country you’ll need to exchange the comma to a period and the semi-colon to a comma.

    Did it work?

    I hope that helps!

    Have a fantastic week!

    Best,

    Andrée Starå

    Workflow Consultant / CEO @ WORK BOLD

    ✅Did my post help answer your question or solve your problem? Please help the Community by marking it as the accepted answer. It will make it easier for others to find a solution or help to answer!

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

  • Thank you both. And apologies for the time that has passed. The calculation idea was not needed anymore, but I still went ahead and checked. Though these formulas do provide some numbers, they're coming out more than what I can count on smartsheet (the formula reveals 17 instances where two values are together, and on the source sheet there are 14 instances)


    Best,

    Yogin

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭

    @Yogin Bhatti Ok. Thanks for the update!

    Let us know if you want to look at it again.

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!