Is it posibble to have If(Isblank) return a yes, no, NA?

Options
north
north
edited 04/02/24 in Formulas and Functions

ColA will have a date or NA. ColB will have a date. I would like Col C to be blank if ColA is blank, =Yes if ColB is <=ColA, =No if ColB is >ColA, and NA if ColA is NA

Is this possible??

I get this far, but not sure how to autmate the NA

=IF(ISBLANK([ColA]@row), "", IF([ColA]@row <= [ColB]@row, "yes", "no"))

Best Answer

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    Answer ✓
    Options

    Hey @north

    Since your ColA isn't a date only column, the formula needs to verify that dates are in the cell in order to 'do the math' of less than or greater. Try the formula below:

    =IF(AND(ISDATE(ColA@row), ISDATE(ColB@row), ColB@row <= ColA@row), "Yes", IF(AND(ISDATE(ColA@row), ISDATE(ColB@row), ColB@row > ColA@row), "No", IF(ColA@row = "NA", "NA")))

    Will this work for you?

    Kelly

Answers

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    Answer ✓
    Options

    Hey @north

    Since your ColA isn't a date only column, the formula needs to verify that dates are in the cell in order to 'do the math' of less than or greater. Try the formula below:

    =IF(AND(ISDATE(ColA@row), ISDATE(ColB@row), ColB@row <= ColA@row), "Yes", IF(AND(ISDATE(ColA@row), ISDATE(ColB@row), ColB@row > ColA@row), "No", IF(ColA@row = "NA", "NA")))

    Will this work for you?

    Kelly

  • north
    Options

    That did the trick thank you!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!