8 Replies Latest reply: Jun 20, 2016 1:06 PM by Tamil arasu RSS

    AddMonths function

    Linda Pembroke


      I am needing to have 4 text objects showing the most recent 4 reporting dates. Our reporting dates are the last day of each month, so for example I need them to show 5/31/16, 4/30/16, 3/31/16, & 2/29/16. I am able to get the most recent reporting date by using the below formula, but when I try to use the AddMonths function to get the previous month, it is showing the same day value. So, it's showing 5/31/16 & 4/31/16 when I need it to be 4/30. Anyone know how to get the last day of each month to populate?


      =If(Only(Year),Date(Max(ReportDate)), 'M/D/YYYY')

      =If(Only(Year), Date(AddMonths(Max(ReportDate), -1), 'M/D/YYYY'))