Hello!
I am working on a column formula (Column Type: Symbol, Symbol Value: RYG light) for a project plan sheet that will calculate task health based on a number of factors. The goal is to use this column formula in place of user intervention and to streamline health calculation across all projects based on set criteria. The formula is as follows:
=IF(COUNT(CHILDREN([Task Name]@row)) > 0, IF(COUNT(CHILDREN([Task Name]@row)) <> COUNTIFS(CHILDREN(), ISBLANK(@cell)), IF(OR(COUNTIF(CHILDREN(), "Red") > COUNTIF(CHILDREN(), "Yellow"), COUNTIF(CHILDREN(), "Red") > COUNTIF(CHILDREN(), "Green")), "Red", IF(COUNTIF(CHILDREN(), "Red") > 0, "Yellow", IF(OR(COUNTIF(CHILDREN(), "Green") > COUNTIF(CHILDREN(), "Red"), COUNTIF(CHILDREN(), "Green") > COUNTIF(CHILDREN(), "Yellow")), "Green", "Yellow")))), IF(ISBLANK([End Date]@row), "", IF(Status@row = "Complete", "Green", IF([End Date]@row < TODAY(), "Red", IF([At Risk]@row = 1, "Yellow", IF([End Date]@row > TODAY(), "Green", IF(OR([End Date]@row = TODAY(), [End Date]@row = TODAY(1)), "Yellow")))))))
It is designed to first check if the row is a parent row and calculate an "average" health based on its children. This allows us to add multiple hierarchies without having to worry about creating separate formulas for parent and child rows. If the row is not a parent row, the health is calculated based on date, task status, and risk status.
This formula has generally been successful, but I am running into a few issues with parent task health. There are two examples where I think the health is calculating incorrectly. I am unable to determine why. Below is a screenshot with examples of where I think the health is calculating incorrectly (see rows "Phase 3" and "Phase 4"); in both cases, I'm expecting the health to be yellow.
Phase 3: I'm expecting this to be yellow. I would assume this hits the IF(COUNTIF(CHILDREN(), "Red") > 0, "Yellow" condition because it does not meet the criteria of "Count Red Children > Yellow Children or Count Red Children > Green Children".
Phase 4: I'm expecting this to be yellow. I thought this would hit the "Otherwise Yellow" criteria in the IF(OR(COUNTIF(CHILDREN(), "Green") > COUNTIF(CHILDREN(), "Red"), COUNTIF(CHILDREN(), "Green") > COUNTIF(CHILDREN(), "Yellow")), "Green", "Yellow" condition. I don't see where this would meet any of the previous criteria.
Any insight would be greatly appreciated.