Formula to say less or more than 30 days
I need a formula that says if the event date is less then 30 days from the date the record was created return the words "less than 30 days" but if its more than 30 days return the words "more than 30 days"
This is what I came up with but getting an error. Help?
=IF(ISDATE([Event Date]@row), IF(DATEDIFF([Event Date]@row, [Created]@row, "d") <= 30, "Less than 30 days", "More than 30 days"),"")
Best Answer
-
Nevermind I figured it out
=IF(ISDATE([Event Date]@row), IF(AND([Event Date]@row > [Created]@row, [Event Date]@row <= [Created]@row + 30), "Less than 30 days from today", "More than 30 days from today"), "")
Answers
-
Smartsheet does not have a DATEDIFF function. Try just subtracting one date from the other.
[Event Date]@row - Created@row
-
Thanks, that will tell me how many days between, but I need it to say over 30 days or under 30 days?
-
Right. You would still need to use your nested IF statement. The above suggestion of date minus date is in place of where you currently have the DATEDIFF function.
-
Thank you for your help. I think I'm getting closer but still getting an error
=IF([Event Date]@row - [Created]@row), <= 30, "Less than 30 days", "More than 30 days", "")
-
Try removing the closing parenthesis from after Created@row.
-
You're saying this? I'm still getting an error :(
=IF([Event Date]@row - [Created]@row, <= 30, "Less than 30 days", "More than 30 days", "")
-
Nevermind I figured it out
=IF(ISDATE([Event Date]@row), IF(AND([Event Date]@row > [Created]@row, [Event Date]@row <= [Created]@row + 30), "Less than 30 days from today", "More than 30 days from today"), "")
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.5K Get Help
- 424 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 145 Just for fun
- 62 Community Job Board
- 464 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!