The information in this article applies to:
SYMPTOMSWhen using the Round() function in Visual Basic 6.0, a different result may be returned than when using it in a cell formula of an Excel spreadsheet. CAUSEThe VBA Round() function uses Banker's rounding while the spreadsheet cell function uses arithmetic rounding. RESOLUTIONWrite a custom function to get the desired results. STATUSThis behavior is by design. MORE INFORMATIONThe Round() function in an Excel spreadsheet uses Arithmetic rounding, which always rounds .5 up (away from 0). The Round() function in Visual Basic for Applications 6, uses Banker's rounding, which rounds .5 either up or down, whichever will result in an even number. Steps to Reproduce Behavior
REFERENCESFor additional information on rounding, click the article number below to view the article in the Microsoft Knowledge Base: Q196652 HOWTO: Implement Custom Rounding Procedures © Microsoft Corporation 1998, All Rights Reserved. Additional query words:
Keywords : kbVBp600 kbGrpVBDB kbExcel97 kbVBA600 |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |