Parent Status based on Children Statuses - Need help refining this formula

Options

Hey Smartsheet Community!

I have a beast of a formula that has probably gotten a bit away from me, but I need help refining this so it meets certain criteria per our stakeholders vision.

Here's the formula:

=IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Complete"), "Complete", IF(COUNT(CHILDREN()) = AND(COUNTIF(CHILDREN(), "Complete") >= 1, OR(COUNTIF(CHILDREN(), "Canceled") > 0, COUNTIF(CHILDREN(), "On Hold") > 0)), "Complete", IF(OR(CONTAINS("In Progress", CHILDREN()), AND(COUNTIF(CHILDREN(), "Complete") > 0, COUNTIF(CHILDREN(), "Not Started") >= 0, COUNTIF(CHILDREN(), "Upcoming") >= 0, COUNTIF(CHILDREN(), "On Hold") >= 0)), "In Progress", IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Upcoming"), "Upcoming", IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Not Started"), "Not Started", IF(OR(CONTAINS("Upcoming", CHILDREN()), COUNTIF(CHILDREN(), "Not Started") > 0), "Upcoming", IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Canceled"), "Canceled", "Not Started")))))))


Here's the goal of the "IFs" summarized:

If all children are complete, parent is complete

If all children are a combination of complete, canceled and/or on hold, then the parent is complete

if one child is complete or in progress, and the rest are either not started, upcoming, canceled, or on hold, then the parent is in progress

if all children are upcoming, parent is upcoming

if one child is upcoming and the rest are not started, the parent is upcoming

If all children are canceled, parent is canceled

Otherwise, parent is Not Started.

Here are the four scenarios I'm running it issues with:

image.png


Parent 1 and Parent 2 should both be complete because we don't want to wait for "On Hold" or "Canceled" tasks

Parent 3 and Parent 4 should be Not Started as the canceled and on hold tasks should not change the status to Upcoming.


Any assistance would be greatly appreciated! All other scenarios I can think of are working as expected. Thank you in advance!

Best Answer

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!