# Conditional formula - if a date is less than 30 days from today

Options
✭✭✭✭

I'm trying to create a conditional formula to flag if less than 30 days from today. I create a separate column to calculate but I am getting an error on the formula.

=IF(AND([Event Date] > TODAY(), [Event Date] <= TODAY() + 30), "Less than 30 days from today", "More than 30 days from today")

Help?

• ✭✭✭✭✭✭
Options

Try this:

=IF(ISDATE([Event Date]@row), IF(AND([Event Date]@row > TODAY(), [Event Date]@row <= TODAY(30)), "Less than 30 days from today", "More than 30 days from today"), "")

• ✭✭✭✭✭✭
Options

=IF(AND([Event Date]@row > TODAY(), [Event Date]@row <= TODAY(30)), "Less than 30 days from today", "More than 30 days from today")

• ✭✭✭✭
Options

Thank you so much! H

How do I add if it blank to leave the cell blank??

• ✭✭✭✭✭✭
Options

Try this:

=IF(ISDATE([Event Date]@row), IF(AND([Event Date]@row > TODAY(), [Event Date]@row <= TODAY(30)), "Less than 30 days from today", "More than 30 days from today"), "")

• ✭✭✭✭
Options

Thank you!

• ✭✭✭✭
Options

You were so incredably helpful with this. I have an additional ask... if instead of TODAY i wanted it to look at the "Created" date instead, how would I write that? I tried the following but getting an error

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

• ✭✭✭✭
Options

Nevermind, I got it :)

=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!