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
Jon BredensteinerProject ManagerAsked:
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.

Jon BredensteinerProject 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","")
Jon BredensteinerProject 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???

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.
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Jon BredensteinerProject 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?

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jon BredensteinerProject ManagerAuthor Commented:
Thank you very much for your help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Project Management Software

From novice to tech pro — start learning today.