Multiple Criteria IF Statement

Kendra Hillmer
Kendra Hillmer ✭✭✭✭✭
edited 02/22/23 in Formulas and Functions

We are trying to produce this formula to give us a pass, fail or ready for testing status based on the columns below and are having some issues.

Pass: when Tester passes equals the number of Test cases per tester

Fail: occurs when there are any fails in the tester fail column

Ready to Test: cases per tester is not equal to passed or there is no fails

Thank you for your help!

=IF([RCC - Test Cases Per Tester]@row = [RCC - Tester Passes]@row, "Pass", IF([RCC - Tester Fails]@row > 0, "Fail", IF(AND([RCC - Test Cases Per Tester]@row <> [RCC - Tester Passes]@row, AND([RCC - Tester Fails]@row = 0, "Ready to Test", "")))))


Best Answer

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭
    edited 02/22/23 Answer ✓

    Sorry for the multiple posts -- your original code broke because you have a second "AND" statement and you didn't close them properly.

    =IF( [RCC - Test Cases Per Tester]@row = [RCC - Tester Passes]@row, "Pass",

    IF([RCC - Tester Fails]@row > 0, "Fail",

    IF(AND([RCC - Test Cases Per Tester]@row <> [RCC - Tester Passes]@row, [RCC - Tester Fails]@row = 0), "Ready to Test", "")))

    But I'd still start with the "Fail" as that's the simplest scenario.

Answers

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭

    If the "Fail" is a trump card, start there.

    =IF([RCC - Tester Fails]@row > 0, "Fail",

    IF([RCC - Test Cases Per Tester]@row = [RCC - Tester Passes]@row, "Pass",

    IF([RCC - Test Cases Per Tester]@row <> [RCC - Tester Passes]@row, "Ready to Test","")))

    This should work. Let me know if you have isues!

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭

    You might actually be able to simplify it to:

    =IF([RCC - Tester Fails]@row > 0, "Fail",

    IF([RCC - Test Cases Per Tester]@row = [RCC - Tester Passes]@row, "Pass", "Ready to Test"))

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭
    edited 02/22/23 Answer ✓

    Sorry for the multiple posts -- your original code broke because you have a second "AND" statement and you didn't close them properly.

    =IF( [RCC - Test Cases Per Tester]@row = [RCC - Tester Passes]@row, "Pass",

    IF([RCC - Tester Fails]@row > 0, "Fail",

    IF(AND([RCC - Test Cases Per Tester]@row <> [RCC - Tester Passes]@row, [RCC - Tester Fails]@row = 0), "Ready to Test", "")))

    But I'd still start with the "Fail" as that's the simplest scenario.

  • Kendra Hillmer
    Kendra Hillmer ✭✭✭✭✭

    That worked! Thank you SO much Lucas!

    I really appreciate your help - thanks again!

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭✭

    No problem @Kendra Hillmer, happy to help.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!