Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

IF AND OR formula

✭✭✭
edited 05/09/24 in Formulas and Functions

I have been trying for way too long to get this formula working correctly - time to ask the pros. I would like the "At Risk" column to flag if "Due Date" has passed and if "Status" is anything other than "Completed" or "% Compete" is anything other than "100%"

Screenshot 2024-05-09 at 10.55.31 AM.png

I've tried many different ways to get this to work without success. Help is appreciated.

Tags:

Answers

  • Community Champion

    Hi @Jay Klomp,

    Something like this?

    =IF(AND(Status@row <> "Completed", [% Complete]@row < 1, [Due Date]@row < TODAY()), 1, 0)

    Sample output:

    image.png

    I'm not sure about that last line, but since it is complete (percentage wise), I am not sure it would need flagging. Please let us know if you have any problems/questions though!

  • ✭✭✭

    Thanks for helping @Nick Korna. This works but not quite the way that I need it to. With this formula, if "% Completed" is at 100% the row remains unflagged regardless of what the "Status" says. I need it to flag if the row is past due and the status is anything other than Completed or if it is past due and "%Status" is not 100% or both. I'm trying to weed out users that might forget to change one of those columns. This formula also flags the row if there is no info filled out at all.

    Screenshot 2024-05-10 at 8.18.11 AM.png Screenshot 2024-05-10 at 8.18.36 AM.png Screenshot 2024-05-10 at 8.18.54 AM.png Screenshot 2024-05-10 at 8.19.28 AM.png Screenshot 2024-05-10 at 8.19.48 AM.png
  • Community Champion

    You could add in automation workflows to change the values rather than relying on users to do it. For example, if the % complete is 100%, change the Status to "Complete" (and another workflow for vice versa).

  • ✭✭✭

    I could but the problem with an automation is that, in the instance of if "Status" changes to Complete then change cell value in "% Complete", you are given a text field. If I enter 100% in that field, it no longer calculates as a total percentage of its group.

    I think a good formula for the "At Risk" column would still be the better option. If "Due Date" is past and "Status" is anything other than Completed and/or "% Complete" is anything other than 100%. I'm just not sure how to properly string the ANDs and ORs.

  • ✭✭✭

    Nevermind about the automation part. I was overlooking something and it now works. I might be able to make this work now.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions