Microsoft Project Professional 2007 - Duration

M

Mel

I would like to round up or round down the duration to a whole day -- if the
duration is 10.1 thru 10.4 - I would like to display 10 days -- if the
duration is 10.5 - 10.9 - I would like to display 11 days. Thanks in advance
for your assistance.

Sharing the Journey
 
J

Jan De Messemaeker

Hi,

To round the duration itself, you will need a VBA procedure (a macro if you
like)
But to display rounded duration, you only have to customize one of the
custom duration fileds;
Tools
Customize
fields
select a custom duration field
click formula
paste the following formula

[Minutes Per Day]*fix(([Duration]/[Minutes Per Day])+0,5)

That does it

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
M

Mel

Jan -- Thanks for your speedy reply -- I will try this next week. Have a
great day.

Jan De Messemaeker said:
Hi,

To round the duration itself, you will need a VBA procedure (a macro if you
like)
But to display rounded duration, you only have to customize one of the
custom duration fileds;
Tools
Customize
fields
select a custom duration field
click formula
paste the following formula

[Minutes Per Day]*fix(([Duration]/[Minutes Per Day])+0,5)

That does it

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
Mel said:
I would like to round up or round down the duration to a whole day -- if
the
duration is 10.1 thru 10.4 - I would like to display 10 days -- if the
duration is 10.5 - 10.9 - I would like to display 11 days. Thanks in
advance
for your assistance.

Sharing the Journey


.
 
S

Sai

Hi,

To round the duration itself, you will need a VBA procedure (a macro if you
like)
But to display rounded duration, you only have to customize one of the
custom duration fileds;
Tools
Customize
fields
select a custom duration field
click formula
paste the following formula

[Minutes Per Day]*fix(([Duration]/[Minutes Per Day])+0,5)

That does it

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620



I would like to round up or round down the duration to a whole day -- if
the
duration is 10.1 thru 10.4 - I would like to display 10 days -- if the
duration is 10.5 - 10.9 - I would like to display 11 days. Thanks in
advance
for your assistance.
Sharing the Journey- Hide quoted text -

- Show quoted text -

Jan - Can you please check the formula again? fix function does not
take 2 inputs. I tried in both Project 2003 and 2007.

I used round(([Duration]/480))*480; 10.1 is round to 10 and 10.6 is
round to 11.

- Sai, PMP, PMI-SP, MCT, MCTS
http://saipower.wordpress.com
 
S

Sai

I would like to round up or round down the duration to a whole day -- if the
duration is 10.1 thru 10.4 - I would like to display 10 days -- if the
duration is 10.5 - 10.9 - I would like to display 11 days. Thanks in advance
for your assistance.

Sharing the Journey

Couple of more points, I tried to write a macro to do the same job,
where the macro is using custom function instead of fix / round (which
is VB version specific)

*Steps*
1. Choose Tools | Macros | Macro (or) Alt + F8; Macros dialog box
should be displayed
2. Enter the name of the macro, say "RoundDuration"; you will observe
"Create" button is enabled
3. Paste the below code inside the function
Sub RoundDuration()
Dim ts As Tasks
Dim t As Task
Set ts = ActiveProject.Tasks
For Each t In ts
If Not t Is Nothing Then
If Not t.Summary Then
t.Duration = AsymUp(t.Duration / 480) * 480
End If
End If
Next t
End Sub

Function AsymUp(ByVal X As Double, _
Optional ByVal Factor As Double = 1) As Double
Dim Temp As Double
Temp = Int(X * Factor)
AsymUp = (Temp + IIf(X = Temp, 0, 1)) / Factor
End Function
4. Save the macro.

*How it works?*
1. The above code gets the list of tasks in the *active* project and
if it is not a summary task, it rounds its current duration. The
number 480 in the formula Round(t.Duration / 480) * 480 indicates the
number of minutes per day.
2. When the above macro is run, the work and assignment units may get
adjusted accordingly (see Task Type and Effort driven indicator)
3. Warning! The above code will overwrite the existing values in
duration column.

To run the macro visit Tools | Macros | Macro and run the macro.

I suggest you visit http://support.microsoft.com/kb/196652; it has
list of custom code for different types of rounding.

- Sai, PMP, PMI-SP, MCT, MCTS
http://saipower.wordpress.com
 
M

Mel

Thanks for the help -- I left out one of small item -- sometimes my brain
slips --

I have created a column Titled Min Duration which has the following formula
[Duration]*0.9 -- I wish to round Min Duration to a whole number.

I think this has "small" impact on the ??? Again thanks in advacne for any
assistance.

Mel
 
S

Sai

Thanks for the help -- I left out one of small item -- sometimes my brain
slips --

I have created a column Titled Min Duration which has the following formula
[Duration]*0.9 -- I wish to round Min Duration to a whole number.

I think this has "small" impact on the ??? Again thanks in advacne for any
assistance.

Mel



Mel said:
I would like to round up or round down the duration to a whole day -- if the
duration is 10.1 thru 10.4 - I would like to display 10 days -- if the
duration is 10.5 - 10.9 - I would like to display 11 days. Thanks in advance
for your assistance.
Sharing the Journey- Hide quoted text -

- Show quoted text -

Mel - Duration is maintained in minutes, but displayed in hours on the
view by Project.

Replace the formula with:

IIf(Round([Duration]/480)*480>=[Duration],Round([Duration]/480)
*480,Round([Duration]/480+0.5)*480)

How it works?
If (Round([Duration]/480)*480) is greater than current duration, then
rounded value is used
Otherwise 0.5 is added to [Duration]/480 and round functio is applied.

480 - is the minutes per day.

- Sai, PMP, PMI-SP, MCT, MCTS
http://saipower.wordpress.com
 
M

Mel

Thanks -- I am getting close - but not there yet when I enter the formula I
receive the following -- everything rounds UP therefore I think I need
another if statement -- right???

114.3 days 115 days
90.9 days 91 days
0 days 0 days
25.2 days 26 days
0 days 0 days
116.1 days 117 days
0 days 0 days
85.5 days 86 days
0 days 0 days
63.9 days 64 days
0 days 0 days
111.6 days 112 days
90 days 90 days
91.8 days 92 days
0 days 0 days
137.7 days 138 days
0 days 0 days
54.9 days 55 days
0 days 0 days
286.2 days 287 days
0 days 0 days
0 days 0 days
78.3 days 79 days
 
A

Andrew Lavinsky

I did this in a Text field and it worked just fine on the round up/round
down. Note that I used [Minutes Per Day] instead of 480. 480 is probably
correct in 95% of the organizations who use MPP, but [Minutes Per Day] is
perhaps more exact:

Round([Duration]/[Minutes Per Day]) & " d"


- Andrew Lavinsky
Blog: http://blogs.catapultsystems.com/epm
 
M

Mel

Andrew -- thanks that works just fine -- I appreciate everyones effort in
assisting me with this issue.

Sharing the Joruney,

Mel

Andrew Lavinsky said:
I did this in a Text field and it worked just fine on the round up/round
down. Note that I used [Minutes Per Day] instead of 480. 480 is probably
correct in 95% of the organizations who use MPP, but [Minutes Per Day] is
perhaps more exact:

Round([Duration]/[Minutes Per Day]) & " d"


- Andrew Lavinsky
Blog: http://blogs.catapultsystems.com/epm
Thanks -- I am getting close - but not there yet when I enter the
formula I receive the following -- everything rounds UP therefore I
think I need another if statement -- right???

114.3 days 115 days
90.9 days 91 days
0 days 0 days
25.2 days 26 days
0 days 0 days
116.1 days 117 days
0 days 0 days
85.5 days 86 days
0 days 0 days
63.9 days 64 days
0 days 0 days
111.6 days 112 days
90 days 90 days
91.8 days 92 days
0 days 0 days
137.7 days 138 days
0 days 0 days
54.9 days 55 days
0 days 0 days
286.2 days 287 days
0 days 0 days
0 days 0 days
78.3 days 79 days


.
 
S

Sai

Andrew -- thanks that works just fine -- I appreciate everyones effort in
assisting me with this issue.

Sharing the Joruney,

Mel



Andrew Lavinsky said:
I did this in a Text field and it worked just fine on the round up/round
down.  Note that I used [Minutes Per Day] instead of 480.  480 is probably
correct in 95% of the organizations who use MPP, but [Minutes Per Day] is
perhaps more exact:
Round([Duration]/[Minutes Per Day]) & " d"
.- Hide quoted text -

- Show quoted text -

Thanks Mel for confirming the solution works.
 

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