Help with SUMIFS and COUNTAINS/MATCH/FIND

I need help with a formula to Sum every instance a name appears in a multi-select row of a column.


So from the screenshot, I want to Sum the No. of Hours claimed for each type of overtime reason.

Using SUMIFS I have tried using :

=SUMIFS({Overtime Tracker Range 1}, {Overtime Tracker Range 2}, CONTAINS(@row, @range))

However it comes up with 0. I have also tried using FIND and MATCH instead of contains but those come up for Errors



I have then used this formula:

=SUMIFS({Overtime Tracker Range 1}, {Overtime Tracker Range 2}, "Sickness Cover")

Here I have to manually type the name of the OT Reason. However this only registers if there is a single name in a cell and doesn't work if there are more than one in cell.


So I have two problems:

  1. My SUMIFS formula doesn't work if I use CONTAINS/FIND/MATCH
  2. It kind of works if I manually type the name in quotation marks, however only works for the cells with one value and not more than one.


Any help would be greatly appreciated!

Answers

  • Genevieve P.
    Genevieve P. Employee Admin

    Hi @JPFORDTE

    When you're looking for a value in a multi-select column, you can use HAS (instead of CONTAINS) to see if the cell has this specific value.

    Ex:

    =SUMIFS({Overtime Tracker Range 1}, {Overtime Tracker Range 2}, HAS(@cell, "Sickness Cover"))


    Then in order to dynamically change what you're searching for in that cell, you can reference the cell to the left of your formula instead of typing the value in quotes. I don't know the name of your column to the left, so I'll call it "OT Reason" in my example:

    =SUMIFS({Overtime Tracker Range 1}, {Overtime Tracker Range 2}, HAS(@cell, [OT Reason]@row))


    Let me know if this works for you!

    Cheers,

    Genevieve

  • Hi Genevieve,


    Thank you for helping me. I've tried using =HAS


    =SUMIFS({Overtime Tracker Range 1}, {Overtime Tracker Range 2}, HAS({Overtime Tracker Range 2}, [Column2]@row))


    However the cells all come up with 0.

  • Genevieve P.
    Genevieve P. Employee Admin

    Hi @JPFORDTE

    Inside the HAS function you'll want to have @cell be the range instead of {Overtime Tracker Range 2}

    This is because you're looking for the value inside each individual cell of the previously stated range.

    Try this:

    =SUMIFS({Overtime Tracker Range 1}, {Overtime Tracker Range 2}, HAS(@cell, [Column2]@row))


    Cheers,

    Genevieve

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!