SUMIF by month and by year
I have a metrics sheet with a cross sheet reference where I'm calculating a sum for each month with the below formula:
For January =SUMIF({Refund Issue Date}, IFERROR(MONTH(@cell ), 0) = 1, {Refund Amount})
For February =SUMIF({Refund Issue Date}, IFERROR(MONTH(@cell ), 0) = 2, {Refund Amount})
and so on.
How do I include the year in this formula? I want to sum all January refund issue dates for 2025 (and so on).
Thank you!
Best Answer
-
Thanks, Gillian, the below formula is what I ended up using and it worked!
=SUMIFS({Refund Amount}, {Refund Issue Date}, IFERROR(MONTH(@cell ), 0) = 1, {Refund Issue Date}, IFERROR(YEAR(@cell ), 0) = 2025)@cell
Answers
-
Hi @mhint2005
It sounds like you want to use SUMIFS for your formula rather than SUMIF. This lets you have multiple ranges and criterion to check against.
SUMIFS Function | Smartsheet Learning Center
Just be careful of the syntax when using SUMIFS so that you get your ranges and criterion in the correct order (it's the opposite way round to SUMIF, but the above link should help)
Hope that helps
-
Thanks, Gillian, the below formula is what I ended up using and it worked!
=SUMIFS({Refund Amount}, {Refund Issue Date}, IFERROR(MONTH(@cell ), 0) = 1, {Refund Issue Date}, IFERROR(YEAR(@cell ), 0) = 2025)@cell
Help Article Resources
Categories
Check out the Formula Handbook template!