EDATE equivalent in Smartsheet - IFERROR(DATE(YEAR....

Tanya B
Tanya B ✭✭
edited 11/20/24 in Formulas and Functions

I found some examples in previous discussions and tried it

=IFERROR(DATE(YEAR([Sale Month]@row), MONTH([Sale Month]@row) + 1, DAY([Sale Month]@row)), DATE(YEAR([Sale Month]@row) + 1, 1, DAY([Sale Month]@row)))

my theory was if Dec 1 was +1, then Jan would be +2 etc….it seemed to work until Feb onwards it keeps returning Jan 2025??

Answers

  • dojones
    dojones ✭✭✭✭✭

    I think your formula is returning as an error and then defaulting to Jan because this part of formula is hard coded to Jan.

    DATE(YEAR([Sale Month]@row) + 1, 1, DAY([Sale Month]@row))

    Maybe a simpler approach would be to just add 30, 60, or 90 days.

    =[Sale Month]@row + 90

  • Tanya B
    Tanya B ✭✭

    That does not return 1st of the month as not every month has 30days that's why I am trying this route.

    You state that Jan is hard coded, however you can see below it returns a December date (formula for that cell below)

  • Carson Penticuff
    Carson Penticuff ✭✭✭✭✭✭

    Here is a link to a similar question.

    Be warned, adding months in Smartsheet is much more complex than Excel. Give this thread a read and I can help afterwards if it is confusing. (spoiler alert, it is confusing)

    Pinging a couple of people that provided excellent solutions toward the end of that thread.

    @VirgilT @brianschmidt

  • dojones
    dojones ✭✭✭✭✭

    I'm suggesting that you are getting an error which is defaulting to the error condition.

    If you want it to always return the 1st day of month, try this:

    30 Day Excercise - (30):

    =IF(MONTH([Sale Month]@row) + 1 = 13, "1/01/" + (YEAR([Sale Month]@row) + 1), (MONTH([Sale Month]@row) + 1) + "/01/" + YEAR([Sale Month]@row))

    30 Day Excercise - (60):

    =IF(MONTH([Sale Month]@row) + 1 = 13, "2/01/" + (YEAR([Sale Month]@row) + 1), IF(MONTH([Sale Month]@row) + 2 = 13, "1/01/" + (YEAR([Sale Month]@row) + 1), (MONTH([Sale Month]@row) + 2) + "/01/" + YEAR([Sale Month]@row)))

    30 Day Excercise - (90):

    =IF(MONTH([Sale Month]@row) + 3 = 15, "3/01/" + (YEAR([Sale Month]@row) + 1), IF(MONTH([Sale Month]@row) + 3 = 14, "2/01/" + (YEAR([Sale Month]@row) + 1), IF(MONTH([Sale Month]@row) + 3 = 13, "1/01/" + (YEAR([Sale Month]@row) + 1), IF(MONTH([Sale Month]@row) + 3 = 13, "1/01/" + (YEAR([Sale Month]@row) + 1), (MONTH([Sale Month]@row) + 3) + "/01/" + YEAR([Sale Month]@row)))))

    This works through 90 days. Extending to 120 and beyond requires adding more IF similar statements.

    Another way to consider is creating a table with the dates and then using VLookup or Index Match to populate the 30, 60, 90, etc It depends on how far you are planning to extend because the formula gets longer with each month.

  • Tanya B
    Tanya B ✭✭

    couple things….

    1. where is Smartsheet with the EDATE equivalent?

    2. format will not work in those cells now

    3. should the second formula be 14 (see purple square)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!