Customizing Duration Field in Microsoft project

S

Sundar Ramani

I have given the resource allocation and total effort calculated for each
tasks in MS Project. MS Project automatically calculated duration for all the
tasks. The duration is calculated in terms of days.

Almost all the tasks have the duration in decimals. I require it to display
the whole number in the same column. Is that possible?

I tried including the custom filed of say Duration 1 and tried to round the
values of Duration Field. But i could not get the function(round) in the list
of functions MS Project gives.

Is there any function to display only the whole numbers of the Duration
Field? or is there any other way to resolve this?

Please help me out in this regard.
 
J

John

Sundar Ramani said:
I have given the resource allocation and total effort calculated for each
tasks in MS Project. MS Project automatically calculated duration for all the
tasks. The duration is calculated in terms of days.

Almost all the tasks have the duration in decimals. I require it to display
the whole number in the same column. Is that possible?

I tried including the custom filed of say Duration 1 and tried to round the
values of Duration Field. But i could not get the function(round) in the list
of functions MS Project gives.

Is there any function to display only the whole numbers of the Duration
Field? or is there any other way to resolve this?

Please help me out in this regard.

Sundar,
The answer to your first question is "no". Only spare field can be
customized in Project. Unfortunately as you found out, there is no
"round" function in Project. A rounding formula can be created to
customize a spare field but it will require a moderately complex formula
to decode the data value. It is much easier to use the following simple
macro to create the data you want. Note that it puts the rounded value
in a spare text field.

Sub RoundDuration()
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
t.Text1 = Round(t.Duration / 480)
End If
Next t
End Sub

John
Project MVP
 
J

John

Jan De Messemaeker said:
Hi,

CInt is the rounding function. works like a charm.

Jan,
Yeah, I missed that one. Only one thing I will add, it doesn't work
directly with a spare duration field. The user will still have to use in
a spare text field and convert minutes to days. For example,

Text1=CInt([Duration]/480)

John
Project MVP
 
J

Jan De Messemaeker

Hi,
Yes of course... but why do people always use 480 instead of the available
project field Minutes per day? Most of my customers run days of less than
480 minutes.
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
John said:
Jan De Messemaeker said:
Hi,

CInt is the rounding function. works like a charm.

Jan,
Yeah, I missed that one. Only one thing I will add, it doesn't work
directly with a spare duration field. The user will still have to use in
a spare text field and convert minutes to days. For example,

Text1=CInt([Duration]/480)

John
Project MVP
 
J

Jack Dahlgren

I agree with Jan, no need to hardcode the "magic number"
Avoid magic numbers whenever you can.
I just saw a field where they were they used iif(baseline =
42somethingoranother, ...)
It made me cringe. Not only because it wasn't good practice, but because I
might have easily have done that in the past.

-Jack


Jan De Messemaeker said:
Hi,
Yes of course... but why do people always use 480 instead of the available
project field Minutes per day? Most of my customers run days of less than
480 minutes.
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
John said:
Jan De Messemaeker said:
Hi,

CInt is the rounding function. works like a charm.

Jan,
Yeah, I missed that one. Only one thing I will add, it doesn't work
directly with a spare duration field. The user will still have to use in
a spare text field and convert minutes to days. For example,

Text1=CInt([Duration]/480)

John
Project MVP
I have given the resource allocation and total effort calculated for
each
tasks in MS Project. MS Project automatically calculated duration for
all
the
tasks. The duration is calculated in terms of days.

Almost all the tasks have the duration in decimals. I require it to
display
the whole number in the same column. Is that possible?

I tried including the custom filed of say Duration 1 and tried to
round
the
values of Duration Field. But i could not get the function(round) in
the
list
of functions MS Project gives.

Is there any function to display only the whole numbers of the
Duration
Field? or is there any other way to resolve this?

Please help me out in this regard.

Sundar,
The answer to your first question is "no". Only spare field can be
customized in Project. Unfortunately as you found out, there is no
"round" function in Project. A rounding formula can be created to
customize a spare field but it will require a moderately complex
formula
to decode the data value. It is much easier to use the following
simple
macro to create the data you want. Note that it puts the rounded value
in a spare text field.

Sub RoundDuration()
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
t.Text1 = Round(t.Duration / 480)
End If
Next t
End Sub

John
Project MVP
 
J

John

Jan/Jack,
You're are both right of course. Normally I put in the disclaimer that
the fixed factor (480) assumes a normal work day of 8 hours. I neglected
to do so in this case. My bad.

John
Jan De Messemaeker said:
Hi,

CInt is the rounding function. works like a charm.

Jan,
Yeah, I missed that one. Only one thing I will add, it doesn't work
directly with a spare duration field. The user will still have to use in
a spare text field and convert minutes to days. For example,

Text1=CInt([Duration]/480)

John
Project MVP
 
M

Mike Glen

Hi Sundar,

Welcome to this Microsoft Project newsgroup :)

If you are entering Duration in hours that add up to less than whole days,
you're bound to get decimal days. Trying to round these will not alter the
reality of your plan. Another reason why you're getting decimal days, could
be a mis-match between calendars and the default settings. Get these right
and the decimals might go away. You might like to see FAQ Item: 5. Default
Working Hours

FAQs, companion products and other useful Project information can be seen at
this web address: http://www.mvps.org/project/

Hope this helps - please let us know how you get on :)

Mike Glen
Project MVP
See http://tinyurl.com/2xbhc for Project Tutorials
 

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