Solved

# Round off a Value in Microsoft Project to a Whole Number

Posted on 2009-05-27
Medium Priority
11,354 Views
I have the below formula, and I would like it to round to the nearest whole number.  Formatting won't work either, as I want to use the number a another formula too.  This is in a custom number field.

IIf([Number3]>[Number2],0,IIf([Number2]<1 Or [Number3]<1,0,([Number3]/[Number2])*100))

I tried this, but it didn't work:

Rnd(IIf([Number3]>[Number2],0,IIf([Number2]<1 Or [Number3]<1,0,([Number3]/[Number2])*100)))

How can I do this a simple as possible?

Thanks, Jon
0
Question by:Jon Bredensteiner
• 4
• 2

Author Comment

ID: 24488203
I found the below code at the following link, but I cannot make it work...

Format([Duration]/480,"0") & " day" & IIf([Duration]/480>1.5,"s","")

http://www.experts-exchange.com/Software/Office_Productivity/Project_Management/Microsoft_Project/Q_21424986.html?sfQueryTermInfo=1+10+decim+round
0

Author Comment

ID: 24495862
I found a workaround...  I converted the number to text, and used a Left function to remove the decimals:

Left([Number4],2) & "%"

However, I would still like to know if there is a way to round a number to the nearest whole number, as it could be useful some day.  Any suggestions???
0

LVL 15

Expert Comment

ID: 24502836
Jon,

I think you have hit another one that Project does not do. There is no Round function for Project that I am aware of. The RND function you used actually exists but it is for generating a RANDOM number. Project by design tries to give specific and accurate data so rounding kind of goes against the design.

I understand the thought though and as long as you dont need to use the values in other calculations the text conversion should be fine to get your display as you need.

You could use the INT function but it doesn't truly round. It will always go to the last complete whole number so anything from 10.01 to 10.99 would revert to 10.
0

Author Comment

ID: 24503409
What about using Left([Number4],2) to convert it to text, and then using some other function to change it back to a number?
0

LVL 15

Accepted Solution

dbase118 earned 2000 total points
ID: 24503538
Jon,

If your Left([Number4],2) & "%" is simply removing decimals then it in fact is doing the same thing the INT function would do except the INT would return as a numeric value.

So your original long formula would go in [Number4] then Number5 could be INT([Number4]).

You can use the CInt function to convert text to an Integer but you essentially end up with the same answer as you would get by simply using the INT function directly.
0

Author Closing Comment

ID: 31586018
Thank you very much for your help.
0

## Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.