I can definitely see the advantage of being able to add or subtract months without causing issues when crossing years. I’ll have to put that in the toolbox.
Is there a way to set the range for the 11th of the previous month to the 10th of the current month? So that would be considered “current month” ?
something like this would be needed.
IF(DAY(Now)<= 10,
YEAR(Now)*12 + MONTH(Now) - 1,
YEAR(Now)*12 + MONTH(Now))
SIGN(MAX(0,DAY(Date)-10))
*
(YEAR(Date)*12+MONTH(Date))
+
(1-SIGN(MAX(0,DAY(Date)-10)))
*
(YEAR(Date)*12+MONTH(Date)-1)
I have solved this thanks to both @ThinhDinh and @Darren_Murphy. Thank you!
There is an error that shows up in the total previous month for the next month, but it doesn’t really matter.
As you can see in the first picture, we have 6 items for the current month, one for the next, and one for the previous. The correct 1050 is shown for the Total Cost Current Month, and the correct total is shown for the Total Cost Previous Month.
Thank you all.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.