Why is the Nested IF Statement showing "Incorrect Argument"?

Please help, not sure why my nested if statement is incorrect.

The formula I am using is below:

=IF(AND([Completed Date]@row <> "", [Review Date]@row <> ""), "green", IF(AND([Payroll Date]@row <= TODAY() + 31, [Payroll Date]@row > TODAY() - 31), [Payroll Date]@row = "", "Red", "Yellow", "Blue"))

Not sure where I am going wrong, please help, thanks!

Answers

  • Nick Korna
    Nick Korna ✭✭✭✭✭✭

    Hi @yolanda.butler,

    The first part of this nested statement is fine. The error is being caused by the second part where it looks like you want 2 IFs, but only have 1.

    IF(AND([Payroll Date]@row <= TODAY() + 31, [Payroll Date]@row > TODAY() - 31)

    This should have the condition if true, then another IF statement for this part:

    [Payroll Date]@row = "", "Red"

    Is something like this more what you're after?

    =IF(AND([Completed Date]@row <> "", [Review Date]@row <> "", [Payroll Date]@row < TODAY(31), [Payroll Date]@row > TODAY(-31)), "Green", IF([Payroll Date]@row = "", "Red", IF(AND([Completed Date]@row <> "", [Review Date]@row <> ""), "Yellow", "Blue")))

    Conditions:

    Green: Completed & Review Dates both filled, payroll date is filled and within 31 days of today

    Yellow: Green: Completed & Review Dates both filled, payroll date is filed and not within 31 days of today

    Red: Payroll is blank

    Blue: Payroll is filled, but either Completed or Review date is missing.

    Sample:

    Hope this helps, but I appreciate the example may not be exactly what you're after - if you can list the conditions for each status then we can sort out the nested IF statement required.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!