Rounding Question

pokerwoody

New Member
Joined
Aug 18, 2010
Messages
30
Hello,

I need a little help with rounding. I would like to round in .25 but would like to round closes to a reference value. example i am taking midpoint of 1.25 and 1.5 =1.375 if reference value is 1.25 or less i would like it to round to 1.25 if reference value is 1.5 or greater would like it to round to 1.5. if the values are 1.5 and 2 then it would just round to 1.75

thanks for reading.........
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
This may be a bit crude, as I am not THAT great with excel as some people here, but this should work (your number should be in A25, but you can change that easily)
Code:
=IF(RIGHT(A25,2)+0<=12.5,LEFT(A25,FIND(".",A25))&0,IF(RIGHT(A25,2)+0<=37.5,LEFT(A25,FIND(".",A25))&25,IF(RIGHT(A25,2)+0<=62.5,LEFT(A25,FIND(".",A25))&50,IF(RIGHT(A25,2)+0<=87.5,LEFT(A25,FIND(".",A25))&75,LEFT(A25,FIND(".",A25))+1))))+0

Make sure your cell is formatted to number
 
Upvote 0
Actually use this code. This one will work if you put any number while the other would only work with 2 decimal places.

Code:
=IF(RIGHT(A21,LEN(A21)-FIND(".",A21)+1)+0<=0.125,LEFT(A21,FIND(".",A21))&0,IF(RIGHT(A21,LEN(A21)-FIND(".",A21)+1)+0<=0.375,LEFT(A21,FIND(".",A21))&25,IF(RIGHT(A21,LEN(A21)-FIND(".",A21)+1)+0<=0.625,LEFT(A21,FIND(".",A21))&50,IF(RIGHT(A21,LEN(A21)-FIND(".",A21)+1)+0<=0.875,LEFT(A21,FIND(".",A21))&75,LEFT(A21,FIND(".",A21))+1))))+0
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top