# Percentage distribution for (Baseline Cost / Total Cost) • ### Question

• Hi,

How can i see in a column, a task's percentage to the total baselined cost of the summary cost

I need a number column ; "A task's Baseline cost / Total Baseline Cost"

Thank you,

• Edited by Sunday, December 15, 2013 11:06 AM
Sunday, December 15, 2013 7:55 AM

• Hi,

Couldn't you guess? You have (a) summary task(s) with Baseline Cost =0. I had naively hoped you would have verified that. Anyway, here's the correction - but do not hope Project can calculate the percentage when the baseline cost for the summary is zero!

Sub percentcost

if not job is nothing then

if job.outlinelevel>1 then

if job.outlineparent.baselinecost>0 then

job.text1=cstr(round(100*(job.baselinecost/job.outlineparent.baselinecost),2)) & "%"

end if

end if

end if

next job

end sub

Greetings,

Monday, December 16, 2013 10:08 AM

### All replies

• I want to track all tasks'

"Baseline Cost / Cumulative Cost"

Thanks

Sunday, December 15, 2013 11:09 AM
• Easy enough to do what you're asking with a formula. Insert a number column then give it the formula:

[Baseline Cost]/[Cost]*100

That means any value under 100 shows that the task has overspent (bad), whereas values over 100 are underspent (good)

There are a recognised set of metrics defined in Earned Value analysis which do these types of calculation, and while you're not using them, it may be worth implementing a metric which is consistent with the conventions they use as they are more likely to make sense to a wider set of stakeholders. If you use the formula:

[Cost]/[Baseline Cost] * 100

that will give you a number that shows 100 if the costs match the budget exactly, less than 100 shows underspend (i.e. 90% of the budget spent), and over 100 shows an overspend (i.e. 150% of the budget).

I hope that's useful.

Andrew

Sunday, December 15, 2013 12:42 PM
• Thank you Andrew,

Can we see "%" before the value?

Sunday, December 15, 2013 4:22 PM
• Hi Slecukz,

You just need to take Andrew formula and add before a concatenation using "&" symbol:

"% " & Formula..

Hope this helps.

Guillaume Rouyre - MBA, MCP, MCTS

Sunday, December 15, 2013 5:58 PM
• Yep, but you'll need to use a text field rather than a number field, as number fields only contain pure numbers.

Put this formula into any of the custom text fields:

[Baseline Cost]/[Cost]*100 & "%"

Hope that helps,

Andrew

Sunday, December 15, 2013 7:09 PM
• Thanks Andrew and Guillame,

One more question ; i did it but i see it like this;  0,68743529358679348579842

How can i do it like that; 0,69 ?

Monday, December 16, 2013 5:40 AM
• Assuming you wanted 2 decimal places, use the following formula:

round([Cost]/[Baseline Cost]*100,2) & "%"

Thanks,
Andrew

Monday, December 16, 2013 8:19 AM
• Hello,

The replies you got so far are definitely interesting and perfectly right, but none of them address this original question. The reason probably is that what you ask here can NOT be achieved with a formula (no formula can refer to a field from an other task, not even the summary task). To have these figures you will need a VBA procedure. Do you think you could implement it? I could readily produce the code:

Sub percentcost

if not job is nothing then

if job.outlinelevel>1 then

job.text1=cstr(round(100*(job.baselinecost/job.outlineparent.baselinecost),2)) & "%"

end if

end if

next job

end sub

Greetings,

Monday, December 16, 2013 8:43 AM
• Thanks Jan,

I am trying to do it but i see this box what is the problem?

• Edited by Monday, December 16, 2013 9:44 AM
Monday, December 16, 2013 9:44 AM
• Hi,

Couldn't you guess? You have (a) summary task(s) with Baseline Cost =0. I had naively hoped you would have verified that. Anyway, here's the correction - but do not hope Project can calculate the percentage when the baseline cost for the summary is zero!

Sub percentcost

if not job is nothing then

if job.outlinelevel>1 then

if job.outlineparent.baselinecost>0 then

job.text1=cstr(round(100*(job.baselinecost/job.outlineparent.baselinecost),2)) & "%"

end if

end if

end if

next job

end sub

Greetings,

Monday, December 16, 2013 10:08 AM