Counting Children with different results creating different value if true values
I'm using this formula:
=IF(COUNT(CHILDREN([PROJECT ID]@row)) > 0, IF(COUNTIFS(CHILDREN([Task Completed]@row), 1) = COUNT(CHILDREN([PROJECT ID]@row)), "Complete"))
And it's working the way I need it to for the "Complete" status, as it's comparing the number of child rows to the number of times the "Task Completed" column checkbox is ticked and if they match then I'll get a "Complete" status in the box. I'm wondering if there's a way to write another portion in the same function that if the number of child rows counted in this part "IF(COUNTIFS(CHILDREN([Task Completed]@row), 1)" could equal the total count of child rows MINUS 2. The way the sheet is set up, there are a number of subtask child rows under each parent project row, but the last two child subtasks are the "closing" tasks, and the user wants different statuses for when the first 11 subtasks are completed (="In Closing") and when the last two tasks are checked off (="Complete"). Is this possible?
Another note - the Status column and the checkbox columns are separate columns.
Best Answer
-
Try something like this:
=IF(COUNT(CHILDREN([PROJECT ID]@row)) > 0, IF(COUNTIFS(CHILDREN([Task Completed]@row), 1) = COUNT(CHILDREN([PROJECT ID]@row)), "Complete", IF(COUNTIFS(CHILDREN([Task Completed]@row), 1) = COUNT(CHILDREN([PROJECT ID]@row)) - 2, "In Closing")))
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
Answers
-
Try something like this:
=IF(COUNT(CHILDREN([PROJECT ID]@row)) > 0, IF(COUNTIFS(CHILDREN([Task Completed]@row), 1) = COUNT(CHILDREN([PROJECT ID]@row)), "Complete", IF(COUNTIFS(CHILDREN([Task Completed]@row), 1) = COUNT(CHILDREN([PROJECT ID]@row)) - 2, "In Closing")))
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
-
Perfect, thanks Paul!
-
Happy to help. 👍️
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
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!