Aggregate Red, Yellow, Green Status to One Overall Grade

Marvin Francis
edited 10/27/22 in Formulas and Functions

Good day,

I am looking to Aggregate Red/Yellow/Green status into one overall R/Y/G. Here is the criteria for grade 1:

  1. All classes are either yellow, or green, overall grade = green
  2. 3 classes at yellow, overall grade = yellow
  3. Any one class at red, overall grade = red

Here is what I have tried,

=IF(AND([Grade]@row = "1", (OR([Class 1]@row = "Yellow", [Class 2]@row = "Yellow", [Class 3]@row = "Yellow")), (OR([Class 1]@row = "Green", [Class 2]@row = "Green", [Class 3]@row = "Green"))), "Green")

This is not working as expected. Any thoughts on what I am doing wrong here?

Thank you

Best Answers

  • Ryan Sides
    Ryan Sides ✭✭✭✭✭✭
    Answer ✓

    @Marvin Francis

    Hi Marvin, you were very close! Since your red requirement overrides all others, you can put it first. Then check for any greens. If not either of those, it's yellow...

    =IF(OR([Class1]@row = "Red", [Class2]@row = "Red", [Class3]@row = "Red"), "Red", IF(OR([Class1]@row = "Green", [Class2]@row = "Green", [Class3]@row = "Green"), "Green", "Yellow"))

    Please let me know if that works for you!

    -Ryan

    Ryan Sides

    Smartsheet Tips and Tricks for Beginners and Advanced on LinkedIn and YouTube

    Come Say Hello!

  • Ryan Sides
    Ryan Sides ✭✭✭✭✭✭
    Answer ✓

    @Marvin Francis Ah ok.

    Yes, wrap it in an if statement first.

    =IF(Grade@row = "1", IF(OR([Class1]@row = "Red", [Class2]@row = "Red", [Class3]@row = "Red"), "Red", IF(OR([Class1]@row = "Green", [Class2]@row = "Green", [Class3]@row = "Green"), "Green", "Yellow")), "")

    Then you could add a portion for Grade 2:

    =IF(Grade@row = "1", IF(OR([Class1]@row = "Red", [Class2]@row = "Red", [Class3]@row = "Red"), "Red", IF(OR([Class1]@row = "Green", [Class2]@row = "Green", [Class3]@row = "Green"), "Green", "Yellow")), IF(Grade@row = "2", do what you need to do here))

    Ryan Sides

    Smartsheet Tips and Tricks for Beginners and Advanced on LinkedIn and YouTube

    Come Say Hello!

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!