# Stuck on a formula involving dates

edited 12/09/19

Hello formula gods, I need your help once again. :-)

I'm trying to write a formula that looks at 3 different date columns.

1.  Look at the 1. actual completion date, if not blank then make it green,  if it is blank then look at the revised due date column, if not blank then red for past due or yellow for reminder,  if 2. revised due date is blank then look at the 3. original due date column, and red for past due or yellow for reminder.

I have the formula written to look at the actual completion date and the original due date but I don't know how to work in the revised due date if that field isn't blank.

Formula:

=IF(NOT(ISBLANK([Actual Completion Date]45)), "Green", IF(AND([Original Due Date]45 >= TODAY()), "Yellow", IF([Original Due Date]45 < TODAY(), "Red", IF(ISBLANK([Original Due Date]45, 0)))))

Any help is greatly appreciated!

Tags:

• ✭✭✭✭✭✭

I am not sure I completely follow your criteria. Here is what I can gather...

If [Actual Completion Date]@row is a date, "Green".

If [Actual Completion Date]@row is blank, look at the [Revised Due Date]@row.

•      Past Due = "Red" (I assume this means the date is in the past)
•      Reminder = "Yellow" (I assume this is for any other date that is not "Past Due")

If[Revised Due Date]@row is blank, look at the [Original Due Date]@row.

•      Past Due = "Red" (I assume this means the date is in the past)
•      Reminder = "Yellow" (I assume this is for any other date that is not "Past Due")

.

Is this correct? Please feel free to adjust so that it is. From there we can begin working on your formula.

• Yes, that's exactly what I'm looking for.

• ✭✭✭✭✭✭

Excellent. Give this one a whirl...

=IF(ISDATE([Actual Completion Date]@row), "Green", IF(ISDATE([Revised Due Date]@row), IF([Revised Due Date]@row < TODAY(), "Red", "Yellow"), IF([Original Due Date]@row < TODAY(), "Red", "Yellow")))

• This worked perfectly! Thank you so very much!!!

• ✭✭✭✭✭✭

Happy to help!

I was a little short on time, so I didn't give a breakdown of the formula. If you would like a more detailed explanation though, I'd be happy to give one. Just let me know.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!