If child return indicator color based on dates but if parent, average indicators from children

I am looking for a formula to use in a status column that returns red, yellow or green based on criteria. Current I have two formulas:


For children without children (lowest level tasks) I need:


=IF(OR([% Complete]@row = 1, Complete@row = 1), "Green", IF(ISBLANK([Start Date]@row), "", IF(State@row = "delayed", "Red", IF(AND([End Date]@row < TODAY(), AND(Complete@row <> 1, [% Complete]@row <> 1)), "Red", IF(AND([End Date]@row - 5 <= TODAY(), [% Complete]@row <> 1), "Yellow", IF([Start Date]@row > TODAY(), "Blue", "Green"))))))



But if a row is a parent (or grandparent) I need it to simply return the most frequent or common indicator from it's children.


I need to achieve this with one formula that can be used in all cells (regardless of parent or child status) because the sheet will be used a template for many people so I can't have people trying to figure out which formula to use based on what type of row they have.


Ultimately what I'm trying to do it make my top most row accurately reflect overall task health, when the tasks themselves indicate health based on their status compared to start and end dates. So if there's an easier way to do this, I'm open to that as well.

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!