Previous Month Forumla

I would like to populate a series of dates based on the current date. Excell has the function EOMONTH that would work perfect, but it doesn't seem to work in smartsheet. I tested the formula "=EOMONTH(B4,-2)+1" and this gives me what I want. Any thoughts on how to create this in smartsheet?

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Are you looking for the previous month to today's month? If so, are you trying to generate a date that is the last day of that month or the first day of that month, or something entirely different?

  • I'm trying to generate the first day of the previous month. I've come up with this based on some responses here on this help site.

    =IFERROR(DATE(YEAR($Date$2), MONTH($Date$2) - 1, 1), DATE(YEAR($Date$2) - 1, MONTH($Date$2) - 1 + 12, 1)).

    Seems to be working out ok. I also wanted to display the same concept, but look 2 months in the past, and then 3 months in the past and so on. so I just change the "-1" in the formula to "-2", and "-3" and so on. I've tested it and seems ok. I'd welcome any advice on it though.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    That's pretty much it. Well done.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!