Weightage ..?

Member for

18 years 3 months

The value for Duration is a derived number (it’s the difference between Start and Finish) so you can’t set up a formula to force it to something else.



As a workaround, you could do this: Let’s assume that the duration is the product of two factors: Coats of paint (1, 2, or 3); and Number of Widgets. And let’s assume that these are *big* widgets and it takes a day to apply a coat of paint (which can dry overnight).



So the duration for 10 widgets would be 10 days (if they get just 1 coat of paint), 20 days (if they get 2 coats) and 30 days (if they get three coats).



Display the task columns Number1 and Number2. In column 1 put the number of coats of paint; in column 2 put the number of widgets.



Display the column Duration1. Give it the formula:

[Number1]*[Number2]*[Minutes Per Day]



You need [Minutes Per Day] because project stores durations in minutes.



Finally, you need to move "Duration1" into "Duration" and for that you’ll need a little VBA:





sub DurationOverride()



dim tsk as Task

for each tsk in activeproject.tasks

If not tsk is nothing then ’ignore blank lines

if not tsk.summary then ’ignore summary tasks

if tsk.duration1 > 0 then ’update tasks that have a calculated value

tsk.duration = tsk.duration1

end if

end if

end if

next



Note that if you have tasks with a FNLT, FNET, MFO Constraint type then the Start Date will move to an earlier date (the Finish date is locked and won’t move).



Note that if you have predecessors/successors on the task where you have calculated the Duration then Project will impose those constraints on the task Start/Finish as well.