SumIF Formula

I am trying to do a sum of cures by year, I have a column for the month "Date" and many other columns. here is the formula I am using but the result = 0 =SUMIF(Date:Date, IFERROR(YEAR(@cell), 0) = YEAR(TODAY(2020)), [Cure Amount]:[Cure Amount]). Thanks for your help.

Best Answer

  • Steven Stikons
    Steven Stikons ✭✭✭
    Answer ✓

    Hi Ivan,

    You are getting 0 because by entering 2020 in the TODAY function you are getting a date that is 2,020 days ahead of TODAY. If you truly want your criteria to be the YEAR for TODAY (July 28, 2021), then enter 0 in the TODAY function. Alternatively, if you want the year to be 2020, there is no need to use the YEAR or the TODAY function; rather, just use the integer 2020. See below:

    =SUMIF(Date:Date, IFERROR(YEAR(@cell), 0) = 2020, [Cure Amount]:[Cure Amount])

    OR

    =SUMIF(Date:Date, IFERROR(YEAR(@cell), 0) = YEAR(TODAY(0)), [Cure Amount]:[Cure Amount])

Answers

  • Steven Stikons
    Steven Stikons ✭✭✭
    Answer ✓

    Hi Ivan,

    You are getting 0 because by entering 2020 in the TODAY function you are getting a date that is 2,020 days ahead of TODAY. If you truly want your criteria to be the YEAR for TODAY (July 28, 2021), then enter 0 in the TODAY function. Alternatively, if you want the year to be 2020, there is no need to use the YEAR or the TODAY function; rather, just use the integer 2020. See below:

    =SUMIF(Date:Date, IFERROR(YEAR(@cell), 0) = 2020, [Cure Amount]:[Cure Amount])

    OR

    =SUMIF(Date:Date, IFERROR(YEAR(@cell), 0) = YEAR(TODAY(0)), [Cure Amount]:[Cure Amount])

  • Ivan Perez
    Ivan Perez ✭✭✭

    Thank Steven that work

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!