Round off a Value in Microsoft Project to a Whole Number

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Project ManagerAuthor Commented:
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
Project ManagerAuthor Commented:
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
Commented:
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
Project ManagerAuthor Commented:
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
Commented:
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

Experts Exchange Solution brought to you by