Count Formula

Maria Watters
Maria Watters ✭✭✭✭✭
edited 08/24/22 in Formulas and Functions

Hello,

I am working on the below formula and I am not sure if it is even possible to combine the two. I am wanting (in the Health column) to count if there are more than three red health subtasks, to show as red, if there are more than 3 yellow, to show as yellow, and anything else to be green. I would also like it to show that if a task is marked as complete, it will show as blue. Is it possible to combine the count formula with what is in the status column?

=IF(AND(COUNTIFS(CHILDREN(), "Red") >= 3, "Red", IF(COUNTIFS(CHILDREN(), "Yellow") >= 3, "Yellow", "Green"), IF(AND(Status@row) = "Complete", "Blue")))

Tags:

Best Answer

  • Sameer Karkhanis
    Sameer Karkhanis ✭✭✭✭✭✭
    edited 08/24/22 Answer ✓

    You have 4 conditions with 4 different outcomes, however the formula construct above is incorrect as you are ANDing all the conditions, so only 2 results are possible.

    Try this:

    =IF(COUNTIF(CHILDREN(), "Red") >= 3, "Red",
        IF(COUNTIF(CHILDREN(), "Yellow") >= 3, "Yellow",
            IF(Status@row = "Complete", "Blue", "Green")
        )
    )
    


Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!