Using an If Statement to return one of two dates

Hi All

Hope you're well,


Got a little problem, I'm trying to use an if statement to choose between two dates

Eg =if(Column1>0,Column1,Column2) My return column is set to a date format


Really need help here pleeeeaaaaaze

Best Answer

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    Answer ✓

    @VAC Create

    Are those your column names? Column name containing numbers or multiple words need to enclosed in square brackets. And you also need to specify the row for each column name. Using @row in place of the row number will enable the formula to work on every row with changing it.

    Now for your logic. Are you trying to say that if there's a date in Column1, set this date column to the same value as Column1, otherwise, set it to the date in Column2? If so, let's use the ISDATE function in there to check for a date value:

    =IF(ISDATE([Column1]@row), [Column1]@row, [Column2]@row)

    Regards,

    Jeff Reisman

    Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages

    If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

Answers

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭
    Answer ✓

    @VAC Create

    Are those your column names? Column name containing numbers or multiple words need to enclosed in square brackets. And you also need to specify the row for each column name. Using @row in place of the row number will enable the formula to work on every row with changing it.

    Now for your logic. Are you trying to say that if there's a date in Column1, set this date column to the same value as Column1, otherwise, set it to the date in Column2? If so, let's use the ISDATE function in there to check for a date value:

    =IF(ISDATE([Column1]@row), [Column1]@row, [Column2]@row)

    Regards,

    Jeff Reisman

    Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages

    If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

  • Hi Jeff, thank you, when using the ISDATE function my statement had 2 )) at the end, when I deleted on it worked like a bomb.


    Thank You

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!