View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Can anyone help Me for this Problem

i want "b" value as 1.85 but the macro is giving me 1.84.

What can i do for this ?


Hi. I believe the vba version uses the Round-to-even method
http://en.wikipedia.org/wiki/Rounding

Seems like the help system in Excel 2007 dropped some of this information.

Sub Arvind()
Dim a, b
a = 1.845
b = Round(a, 2)
b = WorksheetFunction.Round(a, 2)
End Sub

--
Dana DeLouis


"Arvind Mane" wrote in message ...

Please go through the following excel Macro

Sub Arvind()
a = 1.845
b = Round(a, 2)
End Sub


i want "b" value as 1.85 but the macro is giving me 1.84.
What can i do for this ?