Having trouble returning valid dates

SASardy
SASardy ✭✭✭✭
edited 01/26/24 in Formulas and Functions

I am trying to track dates that are reliant upon a variable field. When the variable field is "x", the return in the second column should be the original date plus 1 year and 1 day. When the field is not "x", the return should be the original date plus 2 years and 1 day (edit for clarity: the first column should just be the original date plus 1 day). The problem I am running into is with any date that falls on the 31st of the month, it returns an #INVALID VALUE. Below are screenshots of a few dates I put in to test along with my formula. Can anyone help me solve this???



Best Answer

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    Your formula in your original post was already adding one year or two years to the date. Literally the only problem with the original formula was that your +1 was in the wrong spot. If you use the formula you provided in the screenshot of your original post and adjust where the +1 is, you will get the days and the years added as needed.


    Just use your original formula and make the tweaks to the +1s that I suggested and you will have a formula that does what you want it to do including adding years.

«1

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!