Formula Calculation for Summary Task

S

Sebastian Cordoba

Hi everyone.

I've created a custom field [Number 1], but I need the Summary tasks to be
calculated as the Average of the subtasks which has a value different from 0.
By default the average is calculated over ALL of the subtasks, and I don't
want that in ths case.

Example:
Task Name [Number 1]
---------------------------------------
Summary Task 150/2 = 75
T1 100
T2 50
T3 0
T4 0
 
J

John

Sebastian Cordoba said:
Hi everyone.

I've created a custom field [Number 1], but I need the Summary tasks to be
calculated as the Average of the subtasks which has a value different from 0.
By default the average is calculated over ALL of the subtasks, and I don't
want that in ths case.

Example:
Task Name [Number 1]
---------------------------------------
Summary Task 150/2 = 75
T1 100
T2 50
T3 0
T4 0

Sebastian,
In order to selectively average subtasks under a summary line you will
need to use VBA. You can't get there with a formula.

John
Project MVP
 
S

Sebastian Cordoba

Hi John.

Any ideas of how to identify the subtasks that "belong" to a summary task? I
mean, how do I know that a specific task is part of a summary task and not
other? Maybe I can use the Outline level?

Thanks.
 
J

John

Sebastian Cordoba said:
Hi John.

Any ideas of how to identify the subtasks that "belong" to a summary task? I
mean, how do I know that a specific task is part of a summary task and not
other? Maybe I can use the Outline level?

Thanks.

Sebastian,
In Project VBA, the OutlineChildren Property of a Task object identifies
subtasks belonging to a given summary. If you only have one level of
summary tasks (i.e. no summaries under summary lines), then setting up
the code to do what you want is pretty straightforward using the above
property. However, if you have multiple outline levels, then what you
want to do, (i.e. calculate a selected "average"), gets more interesting.

The above information is contained in the Project VBA object browser -
part of the Project VBA help file. However, with the release of Project
2007, in my opinion Microsoft pretty much nullified the usability of the
Project VBA help. Previous versions had problems but they were much
better at providing useful information. If you have not worked with
Project VBA at all or have only limited experience, then I suggest you
look into fellow MVP, Rod Gill's book on the subject. You can find out
more at, http://www.projectvbabook.com.

John
Project MVP
 
S

Sebastian Cordoba

Thank you so much John.

I have multiple outline levels indeed,and I want to do a selected "average",
just like you said...I suppose things got interesting.

Thanks again.
 
J

John

Sebastian Cordoba said:
Thank you so much John.

I have multiple outline levels indeed,and I want to do a selected "average",
just like you said...I suppose things got interesting.

Thanks again.

Sebastian,
You're welcome and thanks for the feedback.

John
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top