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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Excels rounding threshold from .5 to .6

Status
Not open for further replies.

newuser08

Technical User
Feb 12, 2008
29
GB
I currently have to set up a calculator for some easy calculations - however here’s where I become unstuck.
The normal laws of maths state that .5 you round up below .5 down. I need to change the threshold from .5 to .6.
The results of the calculations are worked out to 3 decimal places so:
A result of 0.556 needs to be rounded to 0.56
A result of 0.555 needs to be rounded to 0.55.

I have

=IF(A1-INT(A1)>=0.6,ROUNDUP(A1,3),ROUNDDOWN(A1,2))

However this is the same as rounddown(A1, 2) and is only rounding to the second decimal.

Any suggestions?
 
For two digits rounding:
=ROUNDUP(A1,0)-ROUND(ROUNDUP(A1,0)-A1,2)

combo
 
Thanks a lot Combo I can finally get this finished
 
>for some easy calculations ... I need to change the threshold from .5 to .6

To determine a solution it would be good if you can explain why you want to do that.
 
I was advised by the power that be (within my work place) that the threshold needed to be changed. I did question but was deafend by the silence. The only logical solution I can think of is that there is some penny pinching going on.

In reply to Combo:

=ROUNDUP(A1,0)-ROUND(ROUNDUP(A1,0)-A1,2) works well if you manually type a figure of lets say 0.785, however if the 0.785 is the result of a sum then it returns 0.79 not the required 0.78.

Surgestions?????
 
Try adding the trunc function

=ROUNDUP(TRUNC(A1,3),0)-ROUND(ROUNDUP(TRUNC(A1,3),0)-TRUNC(A1,3),2)


ck1999
 
My ms excel rounds 0.785 to 0.78 (=ROUNDUP(A1,0)-ROUND(ROUNDUP(A1,0)-A1,2) formula). Are you sure that there are no more digits after 0.785 (try general format)?

combo
 
I think =ROUND(A1-0.001,2) will give the results that you want rather more simply than the other suggestions.

Gavin
 
Combo: there were additional decimals when set to general
0.178571428571429.

ck1999: trunc works great thanks.

Gavona: this works, and yes a lot more simplistic thanks.

Cheers for your help guys, now got it sorted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top