I am trying to write a health formula with the below parameters. I have been playing with the below formula for hours and still cannot get it to match the criteria I need it to below. Any help or suggestions would be GREATLY appreciated!
Health Code Criteria:
If task is "Completed" = Green, If task is "Blocked" = red, If task is "Deferred" = Gray, If task is "Not started" = Gray AND
If a task is 7 days PAST deadline and is not completed = red
If a task is 2 weeks BEFORE deadline and completed = yellow (When it is marked <> Completed all "Not Started" tasks that are within 2 weeks of due date remain gray..this is one error using the below formula).
If a task is 1 day past deadline and not completed = yellow (I can't get this to work AND the 2 weeks before and not completed...how do I do a date range here?)
This is my best attempt at the formula....anyone have any ideas what I am doing wrong?
=IF((Stage@row = "Completed"), "Green", IF((Stage@row = "Blocked"), "Red", IF((Stage@row = "Deferred"), "Gray", IF((Stage@row = "Not Started"), "Gray", IF(AND(Deadline@row < TODAY(+5), Stage@row <> "Completed"), "Red", IF(AND(Deadline@row > TODAY(-10), Stage@row <> "Completed"), "Yellow", IF(AND(Stage@row <> "Completed", Deadline@row > TODAY(+30), "Green", IF(AND(Deadline@row < TODAY(+14), Stage@row = "Not Started", "Yellow", "Green"))))))))))