Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Then Else - Round Up or Round Down 1

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
I have this formula below that works great. However, I have been asked to do this:
Round Up from .20 or greater. Example if value is 4.2 would round to 4 and if value is 4.25 would round to 5. Is this possible? Thank you!


=IIf(Forms![frm_Scheduling Capacity Module-NEW]!APVS=0,Round(Forms![frm_Scheduling Capacity Module-NEW]!DUEQTY_10/30000),Round((Forms![frm_Scheduling Capacity Module-NEW]!DUEQTY_10/Forms![frm_Scheduling Capacity Module-NEW]!APVS)))
 
Something like this ?
=Round(0.30+(Forms![frm_Scheduling Capacity Module-NEW]!DUEQTY_10/IIf(Forms![frm_Scheduling Capacity Module-NEW]!APVS=0,30000,Forms![frm_Scheduling Capacity Module-NEW]!APVS)))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you. Would it not be Round(0.25+...............vs Round(0.20+.........?

Thus any value of 4.2 would not round up and a value of 4.25 would round up to 5?
 
OOps.
you may replace 0.30 with 0.299999

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I haven't tested it yet, so if the expression is:

=Round(0.25+(Forms![frm_Scheduling Capacity Module-NEW]!DUEQTY_10/IIf(Forms![frm_Scheduling Capacity Module-NEW]!APVS=0,30000,Forms![frm_Scheduling Capacity Module-NEW]!APVS)))

any value for example: 4.20 would result in 4 and a value of 4.25 would result in 5? RIght?
 

I suggest you use PHV's advice, which will ALWAYS evaluate as you desire. Adding 0.25 will not always work...
Example: 4.21 + 0.25 = 4.46 which will result in 4, not the 5 you want.


Randy
 
But I don't understand PVS advise. I'm not indicating it is wrong at all. I don't understand the...=Round(0.30+(Forms.....

What does the 0.30+ do to the Rounding function? Thanks
 
It doesn't do anything to the rounding function It adds .2999 to the value so that when it rounds the value 4.21 becomes 4.5 and will round as you wish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top