Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Aug 2004
    Connecticut, USA
    Thanked 0 Times in 0 Posts

    Round function (Access/VBA/Excel) 2k3

    I was just wondering....

    Why does Access and VBA round half numbers differently than Excel? What was MS thinking?

    Access and VBA rounds even integers down and odd integers up. For example 0.5 rounds down to 0 in Access and VBA, while Excel rounds up to 1. 1.5 rounds to 2 using all three methods.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 30 Times in 30 Posts

    Re: Round function (Access/VBA/Excel) 2k3

    Excel uses arithmetic rounding, while VBA (and hence Access) use so-called Banker's rounding. According to MSKB article PRB: Round Function different in VBA 6 and Excel Spreadsheet this is "by design" (the article is from long before the time bankers fell into disrepute <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>).

    Another MSKB article, How To Implement Custom Rounding Procedures has sample code for arithmetic rounding.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts