SUMIFS based on multiple columns including a drop down

Options

I'm trying to calculate the expense of rows based on the type of expense and the month it was spent in. I feel like I'm so close on this formula but keep hitting the "UNPARSEABLE" result. Any tips on how to total an amount based on various drop down options?


Best Answer

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭
    Answer ✓
    Options

    Hmmm... just checked. I think you can actually use an OR statement:

    =SUMIFS(Amount:Amount, [Expense Category]:[Expense Category], OR(@cell="Supplies", @cell="Snacks",@cell="Culture"), [Month Number]:[Month Number], 1)

Answers

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭
    edited 02/22/23
    Options

    Well, your error is because you can only have one condition for [Expense Category]:[Expense Category] and you're trying to get 3. I'm not sure if you can have an "OR" condition, but you could create a helper column with a column (NewColumn) formula that says:

    =IF(OR([Expense Category]@row = "Supplies",[Expense Category]@row = "Snacks",[Expense Category]@row = "Culture"), "Yes","")

    Then update your formula to say:

    =SUMIFS(Amount:Amount, NewColumn:NewColumn, "Yes", [Month Number]:[Month Number], 1)

    Then hide your helper column.

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭
    Answer ✓
    Options

    Hmmm... just checked. I think you can actually use an OR statement:

    =SUMIFS(Amount:Amount, [Expense Category]:[Expense Category], OR(@cell="Supplies", @cell="Snacks",@cell="Culture"), [Month Number]:[Month Number], 1)

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭
    Options

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!