Here's a tricky one that has me stumped.
I have parent/child arrangement of project task completion. Calculating total project completion by using a simple AVG(CHILDREN()) does not get me a true completion value for the entire project.
Someone is going to tell me I went to a lot of trouble when I didn't need to, but what I did to get true project completion status is to add the child-task values and to that, add the child count * 0.00001
what this does is provide a number that contains both the completion value (left side) and child count (right side). This allows me to - at the TopParent row to SUM(CHILDREN()) which gives me a total completion value and total children count of the project. Then using LEFT and RIGHT and VALUE, I can divide the completion value by the count of children and come up with a true project completion percentage (see screenshot).
My problem comes in if I get cute and turn the Parent-Child row fields into strings. I can't figure out how to pull out the number portion using the CHILDREN() function.
To keep the formula simple, I'll just SUM up the VALUEs of the LEFT 4 characters of each child string.
=SUM(VALUE(LEFT(CHILDREN(), 4))) gets me "Invalid data type"
I can individually call out the parend-child by row and it works.
=SUM(VALUE(LEFT([% Total Project]2, 4)), VALUE(LEFT([% Total Project]6, 4)), VALUE(LEFT([% Total Project]9, 4))) gets me a correct value of 5.95
Ultimately I got what I fully wanted in the (row1, %TotalProject) field (see attached) with....
=SUM(VALUE(LEFT([% Total Project]2, 7)), VALUE(LEFT([% Total Project]6, 7)), VALUE(LEFT([% Total Project]9, 7))) + " (" + ROUND(100 * (SUM(VALUE(LEFT([% Total Project]2, 4)), VALUE(LEFT([% Total Project]6, 4)), VALUE(LEFT([% Total Project]9, 4))) / SUM(VALUE(MID([% Total Project]2, 5, 3)), VALUE(MID([% Total Project]6, 5, 3)), VALUE(MID([% Total Project]9, 5, 3)))), 0) + "%)"
But again, I had to call out each parent-child field seperately. And for any project past this simple example grid would be a non-starter.
So how can I perform an integrated function to each child in CHILDREN() and have it roll up to the parent for processing?
