Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, please Visit the Current Forums.

IF Statement

Options
djm714
djm714
edited 12/09/19 in Archived 2016 Posts

I am currently working on an IF statement for RYG. I currently have a statement that turns green if the task is not on the due date and in the future. I have it turn yellow on the due date and red when past due. I am trying to get the IF to work adding grey to the mix that if the column done (checklist) is marked that it will turn grey regardless of the due date. Here is what i have so far. 

 

=IF(AND([Due Date]6 < TODAY(), Done6 = 0), "Red", IF([Due Date]6 = TODAY(), "Yellow", IF([Due Date]6 > TODAY(), "Green", IF(AND([Due Date]6 <= TODAY() >= Done6 = 1), "Gray"))))

 

Thanks,

 

Dan

Comments

  • Greg Gates
    Greg Gates ✭✭✭✭✭
    Options

    It looks like you have a typo in your last IF-statement leading up to "Gray": 

     

    IF(AND([Due Date]6 <= TODAY() >= Done6 = 1)

     

    Should probably read something like:

    IF(AND([Due Date]6 <= TODAY(), Done6 = 1), "Gray")

     

    That being said, I don't think this is necessarily the right order. If you want it to just be Gray no matter what the date is (as long as it's done), I would actually put that first before comparing any dates:

     

    =IF(Done6 = 1, "Gray", IF([Due Date]6 < TODAY(), "Red", IF([Due Date]6 = TODAY(), "Yellow", IF([Due Date]6 < TODAY(), "Green"))))

     

    I hope that helps! Let me know if something isn't clear or if I didn't address your problem.

  • djm714
    Options

    That was great. Thanks

     

This discussion has been closed.