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
|
|
0
|
|
|
|
Reply
|
Utf
|
1/22/2010 11:59:01 AM |
|
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" <Mel@discussions.microsoft.com> wrote in message
news:C1410539-56A3-4FF0-BBDD-98184938924B@microsoft.com...
>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
|
|
0
|
|
|
|
Reply
|
Jan
|
1/22/2010 12:16:34 PM
|
|
Jan -- Thanks for your speedy reply -- I will try this next week. Have a
great day.
"Jan De Messemaeker" wrote:
> 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" <Mel@discussions.microsoft.com> wrote in message
> news:C1410539-56A3-4FF0-BBDD-98184938924B@microsoft.com...
> >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
>
>
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
1/24/2010 12:29:01 AM
|
|
On Jan 22, 5:16=A0pm, "Jan De Messemaeker" <janremovet...@prom-ade.be>
wrote:
> Hi,
>
> To round the duration itself, you will need a VBA procedure (a macro if y=
ou
> 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" =
<M...@discussions.microsoft.com> wrote in message
>
> news:C1410539-56A3-4FF0-BBDD-98184938924B@microsoft.com...
>
>
>
> >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
|
|
0
|
|
|
|
Reply
|
Sai
|
1/25/2010 5:05:25 AM
|
|
you can try 1 for ur query....
[Minutes Per Day]*fix(([Duration]/[Minutes Per Day])+1,4)
I hope this will work. help taken from 'Microsoft Project Software'
(http://www.microsoft.com/project/en/us/project-server-more-info.aspx)
--
valariewood18
------------------------------------------------------------------------
valariewood18's Profile: http://forums.techarena.in/members/177883.htm
View this thread: http://forums.techarena.in/microsoft-project/1295469.htm
http://forums.techarena.in
|
|
0
|
|
|
|
Reply
|
valariewood18
|
1/25/2010 11:20:42 AM
|
|
On Jan 22, 4:59=A0pm, Mel <M...@discussions.microsoft.com> wrote:
> 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 adva=
nce
> 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 =3D ActiveProject.Tasks
For Each t In ts
If Not t Is Nothing Then
If Not t.Summary Then
t.Duration =3D AsymUp(t.Duration / 480) * 480
End If
End If
Next t
End Sub
Function AsymUp(ByVal X As Double, _
Optional ByVal Factor As Double =3D 1) As Double
Dim Temp As Double
Temp =3D Int(X * Factor)
AsymUp =3D (Temp + IIf(X =3D 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
|
|
0
|
|
|
|
Reply
|
Sai
|
1/25/2010 1:08:39 PM
|
|
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" wrote:
> 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
|
|
0
|
|
|
|
Reply
|
Utf
|
1/29/2010 2:09:01 AM
|
|
On Jan 29, 7:09=A0am, Mel <M...@discussions.microsoft.com> wrote:
> 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 formu=
la
> [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 an=
y
> assistance.
>
> Mel
>
>
>
> "Mel" wrote:
> > I would like to round up or round down the duration to a whole day -- i=
f 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 ad=
vance
> > 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>=3D[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
|
|
0
|
|
|
|
Reply
|
Sai
|
1/29/2010 3:35:55 AM
|
|
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
"Mel" wrote:
> 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
|
|
0
|
|
|
|
Reply
|
Utf
|
1/29/2010 10:13:02 PM
|
|
Andrew -- thanks that works just fine -- I appreciate everyones effort in
assisting me with this issue.
Sharing the Joruney,
Mel
"Andrew Lavinsky" wrote:
> 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
> > "Mel" wrote:
> >
> >> 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
> >>
>
>
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
2/2/2010 12:45:01 AM
|
|
On Feb 2, 5:45=A0am, Mel <M...@discussions.microsoft.com> wrote:
> Andrew -- thanks that works just fine -- I appreciate everyones effort in
> assisting me with this issue.
>
> Sharing the Joruney,
>
> Mel
>
>
>
> "Andrew Lavinsky" wrote:
> > I did this in a Text field and it worked just fine on the round up/roun=
d
> > down. =A0Note that I used [Minutes Per Day] instead of 480. =A0480 is p=
robably
> > 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 =A0 =A0115 days
> > > 90.9 days =A0 =A0 91 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 25.2 days =A0 =A0 26 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 116.1 days =A0 =A0117 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 85.5 days =A0 =A0 86 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 63.9 days =A0 =A0 64 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 111.6 days =A0 =A0112 days
> > > 90 days =A0 =A0 =A0 90 days
> > > 91.8 days =A0 =A0 92 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 137.7 days =A0 =A0138 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 54.9 days =A0 =A0 55 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 286.2 days =A0 =A0287 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 0 days =A0 =A0 =A0 =A00 days
> > > 78.3 days =A0 =A0 79 days
> > > "Mel" wrote:
>
> > >> 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 -
Thanks Mel for confirming the solution works.
|
|
0
|
|
|
|
Reply
|
Sai
|
2/2/2010 3:42:56 AM
|
|
|
10 Replies
1268 Views
(page loaded in 7.591 seconds)
|