Help for Formula to Remove #INVALID Data Type for Blank Fields

Hello Smartsheet Community,

I am currently working on a Smartsheet formula to calculate a date that is 6 months out from a given date in the "Date of OK to Release (system-generated)" column. The formula is working as expected when there is a date present in the column, but I'm encountering the #INVALID DATA TYPE error when the field is blank.

Here is the formula I'm using:

=IFERROR(DATE(YEAR([Date of OK to Release (system-generated)]@row), MONTH([Date of OK to Release (system-generated)]@row) + 6, DAY([Date of OK to Release (system-generated)]@row)), DATE(YEAR([Date of OK to Release (system-generated)]@row) + 1, MONTH([Date of OK to Release (system-generated)]@row) - 6, DAY([Date of OK to Release (system-generated)]@row)))

I would greatly appreciate any insights or suggestions on how to modify this formula to handle blank fields and remove the #INVALID DATA TYPE error. Your expertise will be invaluable!

Thank you in advance for your assistance.


Best Answer

  • che.rabajante
    che.rabajante ✭✭✭✭✭
    Answer ✓

    Hello @Deanna Ettinger

    Please try this:

    =IF(ISBLANK([Date of OK to Release (system-generated)]@row), "", IFERROR(DATE(YEAR([Date of OK to Release (system-generated)]@row), MONTH([Date of OK to Release (system-generated)]@row) + 6, DAY([Date of OK to Release (system-generated)]@row)), DATE(YEAR([Date of OK to Release (system-generated)]@row) + 1, MONTH([Date of OK to Release (system-generated)]@row) - 6, DAY([Date of OK to Release (system-generated)]@row))))


    Hope this helps!🙂

    che

Answers

  • che.rabajante
    che.rabajante ✭✭✭✭✭
    Answer ✓

    Hello @Deanna Ettinger

    Please try this:

    =IF(ISBLANK([Date of OK to Release (system-generated)]@row), "", IFERROR(DATE(YEAR([Date of OK to Release (system-generated)]@row), MONTH([Date of OK to Release (system-generated)]@row) + 6, DAY([Date of OK to Release (system-generated)]@row)), DATE(YEAR([Date of OK to Release (system-generated)]@row) + 1, MONTH([Date of OK to Release (system-generated)]@row) - 6, DAY([Date of OK to Release (system-generated)]@row))))


    Hope this helps!🙂

    che

  • Works perfect! Thanks so much!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!