Help with nested if and statements
I have an assessment with different factors to create a final score. There are four individual results that factor in. First determines critical vs non-critical. If "Critical" and any of four individual scores are "No" then 0 pts, if "Yes" then 4 pts, if "Non-Critical" and 1 of the four individual scores are "No" then 2pts. If "Non-critical" and 2 or more of the four individual scores are "No" then 0 pts. if "Non-Critical" and all are "Yes" then 4pts. I am having trouble with the if 1 of 4 and 2 or more parts of the formula.
Best Answers
-
Hi @Lara Kelly,
I think this is what you're after:
=IF(OR(AND([Critical/Non-Critical]@row = "Critical", COUNTIF([Result-1]@row:[Result-4]@row, "Yes") >= 1, COUNTIF([Result-1]@row:[Result-4]@row, "No") = 0), AND([Critical/Non-Critical]@row = "Non-Critical", COUNTIF([Result-1]@row:[Result-4]@row, "Yes") = 4)), 4, IF(AND([Critical/Non-Critical]@row = "Non-Critical", COUNTIF([Result-1]@row:[Result-4]@row, "No") = 1), 2, 0))
Sample output:
The position of a Yes/No/blank won't matter due to using COUNTIF.
If I've misunderstood one of the criteria or you've any problems/questions then please advise. 🙂
-
@Nick Korna Thank you! This works.
Answers
-
Hi @Lara Kelly,
I think this is what you're after:
=IF(OR(AND([Critical/Non-Critical]@row = "Critical", COUNTIF([Result-1]@row:[Result-4]@row, "Yes") >= 1, COUNTIF([Result-1]@row:[Result-4]@row, "No") = 0), AND([Critical/Non-Critical]@row = "Non-Critical", COUNTIF([Result-1]@row:[Result-4]@row, "Yes") = 4)), 4, IF(AND([Critical/Non-Critical]@row = "Non-Critical", COUNTIF([Result-1]@row:[Result-4]@row, "No") = 1), 2, 0))
Sample output:
The position of a Yes/No/blank won't matter due to using COUNTIF.
If I've misunderstood one of the criteria or you've any problems/questions then please advise. 🙂
-
@Nick Korna Thank you! This works.
-
No problem, happy to help! ☺️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!