Reputation: 13
I am trying to use an IF statement to determine if a program is in violation based on the number of weeks the program is at.
If MIC, MIE, CIE is over 4 weeks, "Violation". IF Field Events is over 6 weeks "Violation". If either are under the 4 and 6 week thresholds then "No Violation"
I thought it would look something like this but I cant make it work and I dont know how to write out the second part with Field Events:
IF(OR(A2="MIE", A2="CIE", A2="MIC")AND(F2>4), "Violation", "No Violation"))
The above formula is a stab in the dark.
Upvotes: 1
Views: 145
Reputation: 35970
It is not quite clear what you want to achieve. If you want to nest AND and OR functions, you need to do it like this:
=IF(AND(F2>4,OR(A2="MIE", A2="CIE", A2="MIC")), "Violation", "No Violation"))
Translated: if F2 is greater than 4 and at the same time A2 is either "MIE" or "CIE" or "MIC", then it's a violation.
Upvotes: 2