Summarizing a column based on another multi select column

Options
Mark Hibyan
Mark Hibyan ✭✭
edited 02/17/22 in Formulas and Functions

Hello - I have a column named "Monthly Hours" that lists hours (integers). I have another column called "Site of request" that lists the site(s). That column is multi-select. I would like to summarize hours spent per site. So, if the "Monthly Hours" column has a 10, and the "Site of request" lists "Site A" and "Site B", and if another row has 5 hours for just "Site A", then it would summarize 15 for A and 10 for B.

The ultimate goal here is to graph monthly hours per site.

Any ideas?

Thank you!

Best Answer

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    Answer ✓
    Options

    Hi @Mark Hibyan

    I hope you're well and safe!

    Try something like this.

    =
    SUMIFS([Monthly Hours]:[Monthly Hours], [Site of request]:[Site of request], 
    HAS(@cell, "B"))
    

    Or (if you want to reference the Site in another column)

    =
    SUMIFS([Monthly Hours]:[Monthly Hours], [Site of request]:[Site of request], 
    HAS(@cell, Sites@row))
    

    Did that work/help?

    I hope that helps!

    Be safe and have a fantastic week!

    Best,

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

    Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and 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.

Answers

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    Answer ✓
    Options

    Hi @Mark Hibyan

    I hope you're well and safe!

    Try something like this.

    =
    SUMIFS([Monthly Hours]:[Monthly Hours], [Site of request]:[Site of request], 
    HAS(@cell, "B"))
    

    Or (if you want to reference the Site in another column)

    =
    SUMIFS([Monthly Hours]:[Monthly Hours], [Site of request]:[Site of request], 
    HAS(@cell, Sites@row))
    

    Did that work/help?

    I hope that helps!

    Be safe and have a fantastic week!

    Best,

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

    Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and 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.

  • Mark Hibyan
    Options

    Thank you @Andrée Starå , that worked! I had been playing around with the syntax to no avail. Is there a way to dynamically do this, so that I don't have to create a summary field for each site and hard code the site name? The "Site of request" column is a multi select list for the end user, and there are 16 sites (that can change over time). I'm wondering if there's an easy way to just sum hours (in the "Monthly Hours" column) by site for each site selected, without having to hard code the site name, similar to how you would do it in a reporting tool?


    Thank you!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!