# 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"),"")

• 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"), "")

• 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

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!