Rounding numbers

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
How to round a number
45.74 to 4.79?
33.75 to 33.79?

If number > 5 then round it to 9, otherwise round to 0.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Quite confusing:
Do you want to round the last digit or whoe number.
This is not very clear
45.74 to 4.79?
In both of your examples the final rounding is .09(I guess)
 
Upvote 0
If the last numbers > 5 then round it to 9, otherwise round to 0.

4.74 to 4.70

4.76 to 4.79

Luthius
 
Last edited:
Upvote 0
[ Special Rounding ]

   .<br><br>                                                  <br><table style="border-collapse: separate;" colSpan=2 border=7 cellspacing=0><tbody bgColor="#ffffff"><tr height=52><td colSpan=2>  DataSheet= Sheet1<br>Let's Look & Find <br><b>[ Special Rounding ] </b></td></tr><tr><td width=10 Align="Right"><table cellspacing=1 width=30 style="table-layout:fixed; Font-family:verdana; word-break:break-all;" rowSpan=7><tbody bgColor="#ffffff"><tr height=18><td><Font size=2></Font></td></tr><tr height=18><td bgColor=#dcdcdc Align="Right"><Font size=2>2 </Font></td></tr><tr height=18><td bgColor=#dcdcdc Align="Right"><Font size=2>3 </Font></td></tr><tr height=18><td bgColor=#dcdcdc Align="Right"><Font size=2>4 </Font></td></tr><tr height=18><td bgColor=#dcdcdc Align="Right"><Font size=2>5 </Font></td></tr><tr height=18><td bgColor=#dcdcdc Align="Right"><Font size=2>6 </Font></td></tr><tr height=18><td bgColor=#dcdcdc Align="Right"><Font size=2>7 </Font></td></tr></table></td><td width=374><table bgColor=#939393 cellspacing="1" colSpan=3 rowSpan=3 border=0 width=374 style="table-layout:fixed;Font-family:verdana; word-break:break-all;"><col width=107><col width=105><col width=118><tbody bgColor="#ffffff"><tr height=18><td bgColor=#dcdcdc Align="Center"><Font size=2>A</Font></td><td bgColor=#dcdcdc Align="Center"><Font size=2>B</Font></td><td bgColor=#dcdcdc Align="Center"><Font size=2>C</Font></td></tr><tr height=18><td width=107 bgColor=#ffffff Align="Right"><Font size=2 Color=#000000>45.74</Font></td><td width=105 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>45.70 </Font></td><td width=118 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>45.70 </Font></td></tr><tr height=18><td width=107 bgColor=#ffffff Align="Right"><Font size=2 Color=#000000>33.75</Font></td><td width=105 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>33.79 </Font></td><td width=118 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>33.79 </Font></td></tr><tr height=18><td width=107 bgColor=#ffffff Align="Right"><Font size=2 Color=#000000>145.74</Font></td><td width=105 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>145.70 </Font></td><td width=118 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>145.70 </Font></td></tbody></table><table bgColor=#939393 cellspacing="1" colSpan=3 rowSpan=3 border=0 width=374 style="table-layout:fixed;Font-family:verdana; word-break:break-all;"><col width=107><col width=105><col width=118><tbody bgColor="#ffffff"><tr height=18><td width=107 bgColor=#ffffff Align="Right"><Font size=2 Color=#000000>133.75</Font></td><td width=105 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>133.79 </Font></td><td width=118 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>133.79 </Font></td></tr><tr height=18><td width=107 bgColor=#ffffff Align="Right"><Font size=2 Color=#000000>4.74</Font></td><td width=105 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>4.70 </Font></td><td width=118 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>4.70 </Font></td></tr><tr height=18><td width=107 bgColor=#ffffff Align="Right"><Font size=2 Color=#000000>4.76</Font></td><td width=105 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>4.79 </Font></td><td width=118 bgColor=ccffcc Align="Right"><Font size=2 Color=#000000>4.79 </Font></td></table></td></tr></table><br><TABLE style="BORDER-COLLAPSE: separate; " cellSpacing=0 border=6><colSpan=5 width=800 rowSpan=5 height=90><TBODY><tr height=24><td Align=Center colSpan=5><b><Font size=2>Used Formula </b>...(With Running MicrosoftExcel Ver 2003)</Font><tr height=24><td Align=Center width=4% bgColor=#d3d3d3><Font size=2>No</Font></td><td Align=Center width=9% bgColor=#d3d3d3><Font size=2>Addr'</Font></td><td Align=Center width=65% bgColor=#d3d3d3><Font size=2>  If use below Formula, You'll Get Result as Right</Font></td><td Align=Center width=15% bgColor=#d3d3d3><Font size=2>Result</Font></td><td Align=Center bgColor=#d3d3d3><Font size=2>Etc</Font></td></tr><tr height=20><td Align=Center ><Font size=2>1</Font></td><td Align=Center bgColor=ccffcc><Font size=2>B2</Font></td><td bgColor=ccffcc><Font size=2>=IF(RIGHT(TEXT(A2,"0.00"),1)*1<5,0,0.09)+ROUNDDOWN(A2,1)</Font></td><td Align="Right" ><Font size=2>45.70 </Font></td><td> </td></tr><tr height=20><td Align=Center ><Font size=2>2</Font></td><td Align=Center bgColor=> </td><td><b><Font size=2 Color=#9400d3 size=2>B2</Font></b><Font size=2>  His Formula Used This Cell  -> </Font><b><Font Color=#006400 size=2>B2:B7</Font></b></td><td ><Font size=2> </Font></td><td> </td></tr><tr height=20><td Align=Center ><Font size=2>3</Font></td><td Align=Center bgColor=ccffcc><Font size=2>C2</Font></td><td bgColor=ccffcc><Font size=2>=IF(ROUND(MOD(A2,0.1),2)<0.05,0,0.09)+ROUNDDOWN(A2,1)</Font></td><td Align="Right" ><Font size=2>45.70 </Font></td><td> </td></tr><tr height=20><td Align=Center ><Font size=2>4</Font></td><td Align=Center bgColor=> </td><td><b><Font size=2 Color=#9400d3 size=2>C2</Font></b><Font size=2>  His Formula Used This Cell  -> </Font><b><Font Color=#006400 size=2>C2:C7</Font></b></td><td ><Font size=2> </Font></td><td> </td></tr><tr height=24><td colSpan=5>.</td></tr></TBODY></TABLE><br>                                                  
 
Upvote 0
Thanks for your answer, but now I want a little different.

4.74 to 4.69
4.76 to 4,79
4.23 to 4.19
 
Upvote 0
A slight modification to the formula that theozz provided will give you the result you are looking for. Here is the modified B2 formula:

Code:
=IF((RIGHT(TEXT(A2,"0.00"),1)*1)<5,[COLOR=red]-0.01[/COLOR],0.09)+ROUNDDOWN(A2,1)

Mike
 
Upvote 0
Thank you a lot guys for all your answers.
And mikerickson...
I'm still afraid of you. :eek::eek:

Thank you guys :-D
 
Upvote 0

Forum statistics

Threads
1,224,523
Messages
6,179,301
Members
452,904
Latest member
CodeMasterX

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