Formula to check a parent checkbox when any child is complete & formula to complete a parent status
Hi Smartsheets Community,
I need some help with a formula that I am stuck on. Below is a screen shot of grandparent to parent, to child hierarchy. Grandparent is in yellow, parent is in blue, and child is not highlighted. I put
I am using the following formula to add a check mark on the parent row when all of the children under each parent are all check and when all of the parent rows are checked, then it adds a check mark to the grandparent row. This formula appears to be working.
=IF((COUNT(CHILDREN([Dealer Name]@row))) > 0, IF(COUNT(CHILDREN([Dealer Name]@row)) = COUNTIFS(CHILDREN(), 1), 1))
Next, I am using the formula below to change the Stage Status as follows, but something is not working correctly
- When any of the children under a parent row are checked the stage status changes to "Complete"
- When any of the children are check, I want the parent to show "In Progress"
- When any of the parent rows are showing "In Progress", I want the grandparent row to show "In Progress"
- When all of the children under a parent are checked off, I want the parent row to show "Complete"
- When all of the parent rows are check and the stage status for all parents shows "Complete" I want the grandparent to change to "Complete"
What am I doing wrong? Any help would be greatly appreciated. Formula to check a parent checkbox when any child is complete & formula to complete a parent status
=IF(COUNTIFS(CHILDREN(), @cell = "Complete") = COUNT(CHILDREN()), "Complete", IF(COUNTIFS(CHILDREN(), @cell = "Not Started") = COUNT(CHILDREN()), "Not Started", "In Progress"))
Best Answer
-
Now I am wondering if I misunderstood which stage status you mean (I thought parent, but now I think you mean child)! I have rearranged the criteria, reworded a few, and added a couple. Is this correct?
- If a child Task Complete is checked, the Child Stage Status changes to "Complete".
- If a child Task Complete is unchecked the Child Stage Status is "Not Started".
- If any Child Stage Status is "Not Started" the Parent Stage Status shows "Not Started"
- When any but not all of the children have Task Complete checked, the Parent Stage Status shows "In Progress"
- When all of the children under a parent are checked off, the Parent Stage Status shows "Complete"
- When any of the Parent Stage Status show "In Progress", the grandparent Stage Status shows "In Progress"
- When all of the parent rows are check and the stage status for all parents shows "Complete" the grandparent shows "Complete"
With the exception of the part in bold, @Nick055 's second formula does exactly what you need.
=IF(COUNT(CHILDREN()) > 0, IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Complete"), "Complete", IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Not Started"), "Not Started", "In Progress")), IF([Task Complete]@row = 1, "Complete", "Not Started"))
The only thing it does not do is check whether any of the parent Task Complete boxes are checked (requirement 7). Does it need to? Nick's formula will change the Grandparent Stage Status to "Complete" if all the Parent Stage Status are "Complete". It does not look at the check boxes. If it also needs to check the parent check boxes, let us know and we can adjust the formula.
Answers
-
Can you clarify your requirements? Number 1 is:
- When any of the children under a parent row are checked the stage status changes to "Complete"
Do you mean are checked or do you mean have a Stage Status Complete?
Do you mean any or all? Any is going to be difficult as a parent could have a child with each, what should be returned in that case?
-
Hi Anthony,
I am not sure if this is exactly what you are asking for but it might help.
I do have two solutions for the "Stage Status" formula
-----------------------
This solution is if you want to be able to change a child tasks status manually.
Copy this formula into the parents / grandparents of "Stage Status"
=IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Complete"), "Complete", IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Not Started"), "Not Started", "In Progress"))
----------------------------
This solution makes most of this automated assuming the child tasks are never "In Progress",
You can set this as the column formula for the "Stage Status" column
=IF(COUNT(CHILDREN()) > 0, IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Complete"), "Complete", IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Not Started"), "Not Started", "In Progress")), IF([Task Complete]@row = 1, "Complete", "Not Started"))
This makes it so when the child tasks are unchecked they are "Not Started" and will change to "Complete" when checked. Parents will then see if all of their child tasks are complete & if so will be "Complete". If not, it'll check if their tasks are all "Not Started", if so will be "Not Started". If any of the children are complete but not all, it'll be marked "In Progress. This same rule will apply to the grand parents & their children the same way.Also, for the "Task Complete" column.
If you do this, you could continue to use the "Task Complete" formula in Parents / Grandparents.
There is another option for the "Task Complete" column, but it has a minor flaw. You could create a helper column that fully checks parents & grandparents boxes based on the "Stage Status" column. BUT, they would appear empty in the "Task Complete" column where you check the children off ):
Create a helper column (like "Task Complete Helper") and set the column formula to this
=IF([Stage Status]@row = "Complete", 1, 0)
-
@KPH,
Thank you for getting back to me so quickly. Below are my answers to my requirement # 1. It's supposed to say when ALL children are are checked under a parent row the stage status changes to "Complete"
My apologies as I typed it incorrectly.
Best,
Anthony
-
Now I am wondering if I misunderstood which stage status you mean (I thought parent, but now I think you mean child)! I have rearranged the criteria, reworded a few, and added a couple. Is this correct?
- If a child Task Complete is checked, the Child Stage Status changes to "Complete".
- If a child Task Complete is unchecked the Child Stage Status is "Not Started".
- If any Child Stage Status is "Not Started" the Parent Stage Status shows "Not Started"
- When any but not all of the children have Task Complete checked, the Parent Stage Status shows "In Progress"
- When all of the children under a parent are checked off, the Parent Stage Status shows "Complete"
- When any of the Parent Stage Status show "In Progress", the grandparent Stage Status shows "In Progress"
- When all of the parent rows are check and the stage status for all parents shows "Complete" the grandparent shows "Complete"
With the exception of the part in bold, @Nick055 's second formula does exactly what you need.
=IF(COUNT(CHILDREN()) > 0, IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Complete"), "Complete", IF(COUNT(CHILDREN()) = COUNTIF(CHILDREN(), "Not Started"), "Not Started", "In Progress")), IF([Task Complete]@row = 1, "Complete", "Not Started"))
The only thing it does not do is check whether any of the parent Task Complete boxes are checked (requirement 7). Does it need to? Nick's formula will change the Grandparent Stage Status to "Complete" if all the Parent Stage Status are "Complete". It does not look at the check boxes. If it also needs to check the parent check boxes, let us know and we can adjust the formula.
-
@KPH and @Nick055
I appreciate both of you helping out with a solution and providing me with the formula. What you both provided helped and it worked.
Hope you both had a nice weekend and hope you have a great week.
All the best,
Anthony D'Ambrosio
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63K Get Help
- 380 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 305 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!