What formula do I use to get the SUM of total hours spent between specific dates.

I am trying to create a formula to track how many hours are used between specific dates. The formula I tried is:

=SUMIF({Robert Harrison FY22 Training Range 2}, {Robert Harrison FY22 Training Range 1}, AND(@cell >= DATE(2021,09,27), @cell <= DATE(2021,10,24)))

I get an Invalid Operation when I do that. While the formula above doesn't show it, I used the Time Spent Column as the Range and the Completion date column as the Criterion, and the "AND" as the Sum_Range.

Any help would be greatly appreciated.


Best Answer

  • Jeff M.
    Jeff M. ✭✭✭
    Answer ✓

    Try using SUMIFS instead of the AND in the middle. I tested out this formula and it worked for me.

    Tweak the formula to match your columns and you should be good to go.

    =SUMIFS([Time Spent]:[Time Spent], [Date]:[Date], >DATE(2021, 9, 26), [Date]:[Date], <DATE(2021, 10, 23))

Answers

  • Jeff M.
    Jeff M. ✭✭✭
    Answer ✓

    Try using SUMIFS instead of the AND in the middle. I tested out this formula and it worked for me.

    Tweak the formula to match your columns and you should be good to go.

    =SUMIFS([Time Spent]:[Time Spent], [Date]:[Date], >DATE(2021, 9, 26), [Date]:[Date], <DATE(2021, 10, 23))

  • Thank you Jeff,

    That got me what I needed. The only thing I added was an the equal sign to the dates to make sure it was looking for greater than or equal to, and less than or equal to (=> and =<).


    I really appreciate your assistance with this.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!