C
carey
Is there a way to expressed percent complete in decimal format such as 25.4%
complete?
complete?
carey said:Is there a way to expressed percent complete in decimal format such as
25.4%
complete?
Brian said:Only if you use this VBA code to place a formatted expression of Percent
Complete into a Text field.
Sub DecPercent()
Dim t As Task
For Each t In ActiveProject.Tasks
If Not (t Is Nothing) Then
t.Text1 = Format((t.ActualDuration / t.Duration), "0.0000%")
End If
Next t
End Sub
If you want it to be fewer decimals then remove one or more of the zeros.
carey said:Thanks Brian.
It is not so much a concern for me when a percentage is expressed in
decimals as it is the remaining duration. I have a non-resource loaded
schedule where the remaining durations are required to be expressed as
whole
numbers.
However, to achieve a remaining duration whole number is virtually
impossible if the percent complete can only be expressed as a whole number.
Again, thanks alot.
BTW, I apologize for the three postings. For some reason I was getting a
page fault the first two times I posted it -- and wasn't sure if the first
two went through. I guess it did.
carey said:Steve:
The original duration should always remain the same as originally designed
in your baseline -- unless there is a change order that requires you to
change it. However, even change orders should be expressed as a separate
activity when you are presenting a claims clase.
The primary issue here is that MSP is designed to not change the original
calculated early finish date until the activity is 100% completed. The
remaining duration should change if, lets say, a 2 day activity is 50%
complete. The remaining being 1 day should change the early finish date to
tell you if you are ahead, on, or behind your baseline schedule. But, this,
of course, depends on your data date (status date). However, in my case,
the
early finish (forward pass) does not change regardless what the DD is. This
is a falacy and does not properly represent the true nature of that
activity.
Regarding the remainining duration: I personally need it to be expressed as
a whole number because and since the % complete is linked to the remaining
duration, I get fractions of duration that are sometimes less or more than
the number of remaining days I know is correct.
For instance, when if I have a 3 day duration and I know 1 day of those has
been worked, then two days is remaining. Therefore, the activity is 33.3%
complete. But, since MSP does not utilize fractional percent complete, the
RD
in this case is 2.01. (33% x 3 days = .99 3days - .99 days = 2.01 days.
This
is incorrect Because now the task sheet adds another day to reflect the .01
days and changes the actual duration to reflect this. This is totally
wrong.
Therefore, the algorithim is incorrect.
One should be able to insert a remaining duration to calculate the percent
complete, or, insert a percent complete to obtain a remaining duration.
However, MSP is not designed to manually change the remaining duration or
the
original duration will change and your whole baseline claims case is out of
sync.
That is why I need remaining duration expressed as a whole number. Not a
fraction below or above the true remaining duration.
I hope his explains my question. It is very late and I just came back from
a
two river trip. So, I am a little sun burned right now.
Carey
carey said:Steve:
The original duration should always remain the same as originally designed
in your baseline -- unless there is a change order that requires you to
change it. However, even change orders should be expressed as a separate
activity when you are presenting a claims clase.
The primary issue here is that MSP is designed to not change the original
calculated early finish date until the activity is 100% completed. The
remaining duration should change if, lets say, a 2 day activity is 50%
complete. The remaining being 1 day should change the early finish date to
tell you if you are ahead, on, or behind your baseline schedule. But,
this,
of course, depends on your data date (status date). However, in my case,
the
early finish (forward pass) does not change regardless what the DD is.
This
is a falacy and does not properly represent the true nature of that
activity.
Regarding the remainining duration: I personally need it to be expressed
as
a whole number because and since the % complete is linked to the remaining
duration, I get fractions of duration that are sometimes less or more than
the number of remaining days I know is correct.
For instance, when if I have a 3 day duration and I know 1 day of those
has
been worked, then two days is remaining. Therefore, the activity is 33.3%
complete. But, since MSP does not utilize fractional percent complete, the
RD
in this case is 2.01. (33% x 3 days = .99 3days - .99 days = 2.01 days.
This
is incorrect Because now the task sheet adds another day to reflect the
.01
days and changes the actual duration to reflect this. This is totally
wrong.
Therefore, the algorithim is incorrect.
One should be able to insert a remaining duration to calculate the percent
complete, or, insert a percent complete to obtain a remaining duration.
However, MSP is not designed to manually change the remaining duration or
the
original duration will change and your whole baseline claims case is out
of
sync.
That is why I need remaining duration expressed as a whole number. Not a
fraction below or above the true remaining duration.
I hope his explains my question. It is very late and I just came back from
a
two river trip. So, I am a little sun burned right now.
Carey
carey said:The primary issue is that the newly calculated early finish is before the
data date (status date). This is what is incorrect. It should be the day
after your data date if the activity has a two day duration and the one day
is complete.
carey said:The primary issue is that the newly calculated early finish is before the
data date (status date). This is what is incorrect. It should be the day
after your data date if the activity has a two day duration and the one
day
is complete.
carey said:Regarding your comment that I am searching a way for the forward pass to
calculate dates after the data is is true. This is what I am searching for.
Philip said:Hi Brian,
I noticed this thread of discussion on expressing % complete in decimals.
Our client has requested for us to report our progress in decimals. I tried
to use your VBA code below but I'm not very experienced with VBA. Could you
help with step by step instructions? I'm using Project2000.
I presume this is a macro, so I tried to create one and typed in your code
in Microsoft Visual Basic Editor. But when I go back to Tool/Macro its not
there for me to run it.
Thanks.
John said:Philip said:Hi Brian,
I noticed this thread of discussion on expressing % complete in decimals.
Our client has requested for us to report our progress in decimals. I tried
to use your VBA code below but I'm not very experienced with VBA. Could you
help with step by step instructions? I'm using Project2000.
I presume this is a macro, so I tried to create one and typed in your code
in Microsoft Visual Basic Editor. But when I go back to Tool/Macro its not
there for me to run it.
Thanks.
Philip,
Brian may or may not be able to address your post immediately so let me
take a shot.
First of all, Brian gave two versions of code. The first you WOULD see
if you entered it into the VB Editor and then looed under
Tools/Macro/Macros. The second you will NOT see because it is a Private
sub. In order to view Private sub, go to the VB Editor and hit
View/Project Explorer. On the right side of the screen you should see
the explorer hierarchy with something that says, "VBAProject (your
project name)". Under that you will see, "Microsoft Project Objects" and
under that you will see, "ThisProject(your project name)". If you double
click the latter, the macro code will appear in the code window on the
left side of the screen.
The second version of Brian's code is designed to run automatically so
you don't have to initiate it. However it does have a potential glitch
that should be addressed. If any tasks in the schedule are milestones
(i.e. "0" duration) an error will be generated because the format
formula is trying to divide by zero and in this galaxy, that's a no-no
although I think it may be OK in the Pegasus galaxy - I'll have to check
with Sam or Rodney. At any rate, the corrected code is shown below.
Private Sub Project_Change(ByVal pj As Project)
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing And t.Duration <> 0 Then
t.Text1 = Format(t.ActualDuration / t.Duration, "#.00%")
End If
Next t
End Sub
However, all of the above may be useful information but there is an
easier approach. VBA is not necessary to do what you want. A simple
formula in a custom field will do the trick whether you simply want a
decimal value or a decimal percent value. To set up a formula, do the
following:
1. Go to Tools/Customize/Fields
2. In the Type selection box, select a spare text field (e.g. Text1)
3. Hit the Formula button
4. Enter the following:
IIf([Duration]<>0,format([Actual Duration]/[Duration],"#.00"),"")
If you want a decimal percent value the formula would be:
IIf([Duration]<>0,format([Actual Duration]/[Duration],"#.00%"),"")
5. If you want the same data to appear on summary lines then hit the
option to "Use Formula" for "calculation for task and group summary rows"
That's it, you should be all set.
Just for reference, I agree 100% with Brian. If someone is trying to
show percent complete to multiple decimal places then they are way too
far into the detail.
Hope this helps.
John
Project MVP
Philip said:John said:Philip said:Hi Brian,
I noticed this thread of discussion on expressing % complete in decimals.
Our client has requested for us to report our progress in decimals. I
tried
to use your VBA code below but I'm not very experienced with VBA. Could
you
help with step by step instructions? I'm using Project2000.
I presume this is a macro, so I tried to create one and typed in your
code
in Microsoft Visual Basic Editor. But when I go back to Tool/Macro its
not
there for me to run it.
Thanks.
Philip,
Brian may or may not be able to address your post immediately so let me
take a shot.
First of all, Brian gave two versions of code. The first you WOULD see
if you entered it into the VB Editor and then looed under
Tools/Macro/Macros. The second you will NOT see because it is a Private
sub. In order to view Private sub, go to the VB Editor and hit
View/Project Explorer. On the right side of the screen you should see
the explorer hierarchy with something that says, "VBAProject (your
project name)". Under that you will see, "Microsoft Project Objects" and
under that you will see, "ThisProject(your project name)". If you double
click the latter, the macro code will appear in the code window on the
left side of the screen.
The second version of Brian's code is designed to run automatically so
you don't have to initiate it. However it does have a potential glitch
that should be addressed. If any tasks in the schedule are milestones
(i.e. "0" duration) an error will be generated because the format
formula is trying to divide by zero and in this galaxy, that's a no-no
although I think it may be OK in the Pegasus galaxy - I'll have to check
with Sam or Rodney. At any rate, the corrected code is shown below.
Private Sub Project_Change(ByVal pj As Project)
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing And t.Duration <> 0 Then
t.Text1 = Format(t.ActualDuration / t.Duration, "#.00%")
End If
Next t
End Sub
However, all of the above may be useful information but there is an
easier approach. VBA is not necessary to do what you want. A simple
formula in a custom field will do the trick whether you simply want a
decimal value or a decimal percent value. To set up a formula, do the
following:
1. Go to Tools/Customize/Fields
2. In the Type selection box, select a spare text field (e.g. Text1)
3. Hit the Formula button
4. Enter the following:
IIf([Duration]<>0,format([Actual Duration]/[Duration],"#.00"),"")
If you want a decimal percent value the formula would be:
IIf([Duration]<>0,format([Actual Duration]/[Duration],"#.00%"),"")
5. If you want the same data to appear on summary lines then hit the
option to "Use Formula" for "calculation for task and group summary rows"
That's it, you should be all set.
Just for reference, I agree 100% with Brian. If someone is trying to
show percent complete to multiple decimal places then they are way too
far into the detail.
Hope this helps.
John
Project MVP
Hi John,
Inputting the formula in Customize Fields worked wonderfully. Thank you.
Philip.
John said:Philip said:John said:Hi Brian,
I noticed this thread of discussion on expressing % complete in decimals.
Our client has requested for us to report our progress in decimals. I
tried
to use your VBA code below but I'm not very experienced with VBA. Could
you
help with step by step instructions? I'm using Project2000.
I presume this is a macro, so I tried to create one and typed in your
code
in Microsoft Visual Basic Editor. But when I go back to Tool/Macro its
not
there for me to run it.
Thanks.
Philip,
Brian may or may not be able to address your post immediately so let me
take a shot.
First of all, Brian gave two versions of code. The first you WOULD see
if you entered it into the VB Editor and then looed under
Tools/Macro/Macros. The second you will NOT see because it is a Private
sub. In order to view Private sub, go to the VB Editor and hit
View/Project Explorer. On the right side of the screen you should see
the explorer hierarchy with something that says, "VBAProject (your
project name)". Under that you will see, "Microsoft Project Objects" and
under that you will see, "ThisProject(your project name)". If you double
click the latter, the macro code will appear in the code window on the
left side of the screen.
The second version of Brian's code is designed to run automatically so
you don't have to initiate it. However it does have a potential glitch
that should be addressed. If any tasks in the schedule are milestones
(i.e. "0" duration) an error will be generated because the format
formula is trying to divide by zero and in this galaxy, that's a no-no
although I think it may be OK in the Pegasus galaxy - I'll have to check
with Sam or Rodney. At any rate, the corrected code is shown below.
Private Sub Project_Change(ByVal pj As Project)
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing And t.Duration <> 0 Then
t.Text1 = Format(t.ActualDuration / t.Duration, "#.00%")
End If
Next t
End Sub
However, all of the above may be useful information but there is an
easier approach. VBA is not necessary to do what you want. A simple
formula in a custom field will do the trick whether you simply want a
decimal value or a decimal percent value. To set up a formula, do the
following:
1. Go to Tools/Customize/Fields
2. In the Type selection box, select a spare text field (e.g. Text1)
3. Hit the Formula button
4. Enter the following:
IIf([Duration]<>0,format([Actual Duration]/[Duration],"#.00"),"")
If you want a decimal percent value the formula would be:
IIf([Duration]<>0,format([Actual Duration]/[Duration],"#.00%"),"")
5. If you want the same data to appear on summary lines then hit the
option to "Use Formula" for "calculation for task and group summary rows"
That's it, you should be all set.
Just for reference, I agree 100% with Brian. If someone is trying to
show percent complete to multiple decimal places then they are way too
far into the detail.
Hope this helps.
John
Project MVP
Hi John,
Inputting the formula in Customize Fields worked wonderfully. Thank you.
Philip.
Philip,
You're welcome.
John
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.