SUM if a condition is met

Hello Community,


l browsed around and couldn't find a solution that would apply to my issue. I am trying to sum the total amount per district code. Important note is that a troubleshooter can work any of the districts so l need to leave the grouping per Troubleshooter but sum up the totals per District.

So far l have used the following and getting the #UNPARSEABLE error:

=SUMIF([SES Net Value]:[SES Net Value], [District Code]:[District Code], CONTAINS("OC")@row)

=SUM([SES Net Value]:[SES Net Value], [District Code]:[District Code], CONTAINS("OC")@row)


Help!?

Tags:

Best Answer

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    Answer ✓

    Hey @Silvia Rangel

    You are on the right track with SUMIFS. The UNPARSEABLE is because the syntax is not correct within the CONTAINS function nor is it correct for SUMIF (singular). The good news is that you do not need the CONTAINS function since "OC" is your whole word, not part of a word (for example if you were trying to find instances of octet, octets, and octopus- these entries all CONTAIN "OC") and your current syntax IS correct for the much more versatile SUMIFS function.

    =SUMIFS([SES Net Value]:[SES Net Value], [District Code]:[District Code], "OC")

    Will this work for you?

    Kelly

Answers

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    Answer ✓

    Hey @Silvia Rangel

    You are on the right track with SUMIFS. The UNPARSEABLE is because the syntax is not correct within the CONTAINS function nor is it correct for SUMIF (singular). The good news is that you do not need the CONTAINS function since "OC" is your whole word, not part of a word (for example if you were trying to find instances of octet, octets, and octopus- these entries all CONTAIN "OC") and your current syntax IS correct for the much more versatile SUMIFS function.

    =SUMIFS([SES Net Value]:[SES Net Value], [District Code]:[District Code], "OC")

    Will this work for you?

    Kelly

  • @Kelly Moore Thanks for explaining it so well, it works!!!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!