Link to home
Start Free TrialLog in
Avatar of Jon Bredensteiner
Jon BredensteinerFlag for United States of America

asked on

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
Avatar of Jon Bredensteiner
Jon Bredensteiner
Flag of United States of America image

ASKER

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","")

https://www.experts-exchange.com/questions/21424986/durations-days-showing-up-as-decimals.html?sfQueryTermInfo=1+10+decim+round
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???
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.
What about using Left([Number4],2) to convert it to text, and then using some other function to change it back to a number?
ASKER CERTIFIED SOLUTION
Avatar of dbase118
dbase118
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much for your help.