SUMIF multi-condition syntax

a Coworker and I have been banging our heads on this one for a couple weeks now for a project under development.

We're trying to SUM hours {TotalTime} within a date range that meets a label criteria (@cell, Month16). It actually works until I add the AND condition. Below is my #INCORRECT AURGUMENT SET

=SUMIF({Activity}, HAS(@cell, Month16), {Date}, AND(@cell >= DATE(2022, 1, 1), @cell <= DATE(2022, 1, 31), {TotalTime}))


Any ideas?

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    To have multiple range/criteria sets, you need to use a SUMIFS (with the "S" on the end). Keep in mind that the function does have a different syntax from the SUMIF function.


    You also have a misplaced parenthesis. One of them on the end should be moved to immediately after the second date function closing so that you close off the AND function before moving on to the next portion of the SUMIF/S.

    thinkspi.com

  • I was afraid you were going to say that 😂

    Thank you @Paul Newcome , I'll have at it

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    It should end up looking like this:


    =SUMIFS({Total Time}, {Activity}, HAS(@cell, Month16), {Date}, AND(@cell >= DATE(2022, 1, 1), @cell <= DATE(2022, 1, 31)))

    thinkspi.com