Partilhar via


Three Point Estimation (PERT) in Project 2010: Take 1

  

As some of you may already know the PERT Addin that was in Project for several versions was NOT included in Project 2010. The good news is that below we have the first version of some sample code you can use to add the feature back into the product! This first version does not use a form like the old one. It uses custom fields at the task level to store the Pessimistic, Optimistic and Most Likely estimates and the weights for each estimate. This is just a preliminary version. We hope to gather feedback and then release a future version of the code as a Visual Studio project that can be customized and used to create a Project 2010 Addin.

 

This code depends on using 7 task level custom fields:

Field Name Purpose
Duration1 Optimistic Duration
Duration2 Most Likely Duration
Duration3 Pessimistic Duration
Number1 Optimistic Weight
Number2 Most Likely Weight
Number3 Pessimistic Weight
Text30 Calculation State

 

The image below shows a Gantt Chart view with these fields inserted. In this example we see weights only on the first task. This is an option you can set in the code. If the option is set to ‘False’ then each task can have its own set of weights. Duration estimates are inserted for each task. The code at this point will estimate every task. (We could add the option to allow a project manager to specify which tasks should be estimated.)

image

 

To use this sample code in your own projects:

  1. Open Project 2010
  2. Click on the View Tab of the Ribbon
  3. Click Macro | Visual Basic
  4. Double Click on the “ThisProject (Global.MPT)” node just under the ProjectGlobal node
    image
  5. In the code window that opens up on the right paste in the code below
  6. Decide if you want to use only one set of weights or if you want each task to have its own set of weights
    If you want one set leave the code as it is. If you want separate weights then change this: “UseOneSetofWeights = True” to this:
    ”UseOneSetofWeights = False”
  7. Close the Visual Basic Editor
  8. Click on the “Customize Quick Access Toolbar” item on the ribbon
    image
  9. Click on “More Commands”
  10. In the “Choose commands from” list box pick “Macros”
  11. Select “PERT” in the left hand box and then click the Add button
    image
  12. Click OK

 

Now the code is ready to be used. All that is left is to insert the fields in the table above into a Gantt Chart view, enter your estimates and your weights (Remember that the weights must add up to 6!!) and then run the macro using the Quick Launch button you just added.

 

Feedback Wanted!!

This is just a first pass at a sample for replacing the PERT functionality. Please email me (brian.kennemer@microsoft.com) with your feedback.

Some things to think about:

  • Should there be the ability to specify which tasks should have their Durations estimated when the tool is run?
  • Do you prefer a form for setting the weights?
  • What other options would you like to see?

 

One last thing: This is just sample code and should be thoroughly tested before you use it on a ‘production’ project.

 

_____________________________________________________________________________________________________________

 

Sub PERT()
Dim tskT As Task
Dim tskFirst As Task
Dim FoundBadWeights As Boolean
Dim UseOneSetofWeights As Boolean

UseOneSetofWeights = True
FoundBadWeights = False

CustomFieldRename FieldID:=pjCustomTaskDuration1, NewName:="Optimistic Duration"
CustomFieldRename FieldID:=pjCustomTaskDuration2, NewName:="Most Likely Duration"
CustomFieldRename FieldID:=pjCustomTaskDuration3, NewName:="Pessimistic Duration"
CustomFieldRename FieldID:=pjCustomTaskNumber1, NewName:="Optimistic Weight"
CustomFieldRename FieldID:=pjCustomTaskNumber2, NewName:="Most Likely Weight"
CustomFieldRename FieldID:=pjCustomTaskNumber3, NewName:="Pessimistic Weight"
CustomFieldRename FieldID:=pjCustomTaskText30, NewName:="PERT State"

If UseOneSetofWeights = True Then
    Set tskFirst = ActiveProject.Tasks(1)
    For Each tskT In ActiveProject.Tasks
      If Not (tskT Is Nothing) Then
        If tskT.PercentComplete = 0 And tskT.PercentWorkComplete = 0 Then
          If (tskFirst.Number1 + tskFirst.Number2 + tskFirst.Number3) = 6 Then
            tskT.Duration = ((((tskT.Duration1) * tskFirst.Number1) _
            + ((tskT.Duration2) * tskFirst.Number2) _
            + ((tskT.Duration3) * tskFirst.Number3)) / 6)
            tskT.Text30 = "Duration Calc'd: " & Now()
          Else
            tskT.Text30 = "Not Calc'd: Weights <> 6"
            FoundBadWeights = True
          End If
        Else
          tskT.Text30 = "Not Calc'd: Task In Progress or Complete"
        End If
      End If
    Next tskT
Else
    For Each tskT In ActiveProject.Tasks
      If Not (tskT Is Nothing) Then
        If tskT.PercentComplete = 0 And tskT.PercentWorkComplete = 0 Then
          If (tskT.Number1 + tskT.Number2 + tskT.Number3) = 6 Then
            tskT.Duration = ((((tskT.Duration1) * tskT.Number1) _
            + ((tskT.Duration2) * tskT.Number2) _
            + ((tskT.Duration3) * tskT.Number3)) / 6)
            tskT.Text30 = "Duration Calc'd: " & Now()
          Else
            tskT.Text30 = "Not Calc'd: Weights <> 6"
            FoundBadWeights = True
          End If
        Else
          tskT.Text30 = "Not Calc'd: Task In Progress or Complete"
        End If
      End If
    Next tskT
End If
If FoundBadWeights = True Then
    MsgBox Prompt:="Some Tasks Weight Values were found to be incorrect." & _
    Chr(13) & "Check the Text30 fields for details.", Buttons:=vbCritical, _
    Title:="WorkPERT Weights Error"
End If
End Sub

Comments

  • Anonymous
    January 01, 2003
    Really helpful, worked perfect.

  • Anonymous
    January 01, 2003
    Glen, for sure if you are looking for full stregnth multi-estimate modeling for your scheduling then there are certainly add in tools that go the fully distance. What Im doing here is just a step toward getting the old PERT functionality back into the product in a very lightweight way. Luckily, my thanksgiving schedule did not include a formulaic estimation of cooking time. I took mine out of the recipe, which did NOT factor in cooking in a convection oven by the way. It said 2 hours 10 mins and it cooked to 10 degrees higher than spec in 1 hour 50 mins! :-)

  • Anonymous
    November 26, 2009
    Since the original A+4B+C formula was reverse engieered from a Beta distribution with symetric standard deviations. The Beta was "converted" to a static form through the A+4B+C construct What is the impact on the confidence intervales for the resulting PERT estimate when changes are made to the weighting factors and at the same time the A,B,C estimate are not drawn from the underlying symmetric Beta distribution? Analysis of PERT also shows up to a 27% unfavorable bias in the projected completion date if the Beta symmetry is not maintained in the actual project sample data. Along with ignoring (which PERT does) the correlations between tasks and the none symmetric behaviors of the actual data distributions. The tools you have "may" have unexpected outcomes that are far removed from actual project behaviors. Happy Thanksgiving. But think about the nonlinear cooking times of turkeys. The cooking time of turkeys is related to the surface area - a Rayleigh distribution - a cousin of the Beta.

  • Anonymous
    November 30, 2009
    The comment has been removed

  • Anonymous
    March 20, 2010
    Hello. Just curious what the rationale was for omitting the PERT features in P2010 Thanks

  • Anonymous
    November 19, 2015
    Hello, It does not work with microsoft 2013, I got this Message "Some Tasks Weight Values were found to be incorrect Check the Text 30 fields for details.