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
-
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
-
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
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 67 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!