It might seem strange, but that's the way it is. VBA Round is called "banker's rounding".
But JoeMo described VBA Round incorrectly. It does not always round 5 down. Instead, it rounds to even. So Round(123.5) is 124. And Round (122.5) is 122.
It might seem strange, but that's the way it is. VBA Round is called "banker's rounding".
But JoeMo described VBA Round incorrectly. It does not always round 5 down. Instead, it rounds to even. So Round(123.5) is 124. And Round (122.5) is 122.
To follow up on joeu2004's comment, VBA uses Banker's Rounding for all rounding that it does, even implicit rounding (such as assigning a floating point number to an integer variable as but one example), except for one lone function... the Format function... it does the same kind of rounding as Excel's worksheet functions. So, if you change this code line...
tt = Round(1915.5 * 3.27, 2)
to this either this...
tt = Format(1915.5 * 3.27, "0.##")
or this...
tt = Format(1915.5 * 3.27, "0.00")
(depending on whether the output needs to contain 2 visible decimal places or not) you will get the rounded result you are looking for.
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.