Rounding Error #2

Worksheet function =Round(0.965,2) returns 0.97
Using VBA Round(0.965,2) returns 0.96.
Why does the VBA function not work properly?
mcurrie (76)
8/14/2003 9:36:29 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 4

On Thu, 14 Aug 2003 02:36:29 -0700, "Mike" <> wrote:

>Worksheet function =Round(0.965,2) returns 0.97
>Using VBA Round(0.965,2) returns 0.96.
>Why does the VBA function not work properly?

VBA's round does work properly.  It just uses a different rounding method,
sometimes called banker's rounding.  This is outlined in the MSKB article

Briefly, if the number to the right of your rounding point is '5', and the
number to the left is even, then the number will get rounded down.

So (0.965,2) --> 0.96
   (0.955,2) --> 0.96

ronrosenfeld (3122)
8/14/2003 11:20:10 AM

I'm not sure (I haven't used rounding in excel VBA ever), but it looks
pretty like so-called banker's rounding for VBA (a tie is rounded up or down
depending the value is even ur uneven). PS. Banker's rounding is used in MS

Arvi Laanemets

"Mike" <> wrote in message
> Worksheet function =Round(0.965,2) returns 0.97
> Using VBA Round(0.965,2) returns 0.96.
> Why does the VBA function not work properly?

arvi (37)
8/14/2003 11:23:21 AM

Similar Artilces:

text box must be empty error
Has anyone come across that error that says the "text box must be empty" when doing a Create Text Block Link, and the text box is empty? Any solutions? -- Robert Pearson ParaMind Brainstorming Software Creative Virtue Press/Telical Books/Regenerative Music You can only link to an empty text box. Copy the text in box two, paste it to the end of box one, create an empty text box, link box one to box three, delete box two. -- Mary Sauer MSFT MVP news:// <...

rounding #9
is there a way to have a column round automatically instead of having to round onto another column? I don't want to add another column to just be able to round. -- denhar ------------------------------------------------------------------------ denhar's Profile: View this thread: If the column contains formulas, the formulas can incorporate the Round() function within themselves. For example, if the formula is: =A1*B1 it could be revised to: =ROUND(A1*...

Cell showing date and time
I have a cell set up as format dd/mm/yyyy hh:mm:ss and the contents are 01/01/1995 00:00:00 In the cell below I put 01/01/1995 01:00:00 then fill the cells for a few hundred. After about 200 cells the value shows as 09/01/1995 10:00:01 - in other words the increment being added for each cell is slightly greater than the desired one hour. I assume this is a lack of precision in the cell value. Is there a way of changing this? I am using Excel 2007. Grateful for advice. Enter the first date/time in A1 and in A2 enter: =A2+TIME(1,0,0) and copy down -- Gary'...

error opening saved .pub website
When I try to open the website I saved as a .pub document yesterday, the following error message displays "Publisher has detected a prolem in the file you are trying to open. To protect your computer, Publisher will not open this file." Are there any suggestions for what I can do? I put so much work into it yesterday and really want to recover it. Thanks! Do you have Norton? How to use Office programs with the Norton AntiVirus Office plug-in Error message when you try to open a publication in Publisher: "Publisher cannot op...

round() ?
Hello How can i round float to 2 digits after '.' ? Thanx Quick and Dirty: Multiply by 100, add 0.5 (to round up correctly). convert to long, then back to float, then divide by 100. This is limited to values that will fit within a long, and is not efficient. It is reliable. also: float val; val = val - fmod(val, .01); Or, the real thing: char *_fcvt( double value, int count, int *dec, int *sign ); Which is a char string, which you can then feed to atof() and get your rounded value back. Alas, beware errors in precision limits! Balboos user@domain.invalid wrote: >...

excel LOOKUP( ) error #3
the data matches up and for all other cells in the column, the correc value is returned. in the first row however, N/A is returne -- apple ----------------------------------------------------------------------- apples's Profile: View this thread: ...

MS Visual Basic error message
Whenever I try to enter a formula in cell, I get this MS Visual Basic warning: " Can't find project or library." After I click "OK", I can enter the formula in the cell. How can I get rid of this message? Thanks, CMA ...

memory could not be read error
Hi All, Whenever I tried to open MS Outlook, I get an error "memory could not be read". After a lot of frustration, I tried to Uninstall MS Office and Install it again without success. Can any body tell me the probable reason and the way out. I guess, this might be some AddIns problem automatically installed while connecting to Internet. Any help will be highly appreciated. Thank you all, Sandip ...

#REF #2
I am using Excell 2002 at the office. I have a problem viewing a spreadsheet that a coworker sent me, which she prepared in Excell 2000. Some of the cells display #REF, instead of the formula value. Any ideas on how to resolve this would beappreciated. Thanks. Barry You may be missing an add-in such as the Analysis ToolPak Navigate: Tools,Addin "Barry" wrote: > I am using Excell 2002 at the office. I have a problem viewing a spreadsheet > that a coworker sent me, which she prepared in Excell 2000. Some of the > cells display #REF, instead of the formula valu...

Reg hiding such parameters in the properties of the mail #2
hi , I am using the outlook 2003 client for sending the email. when it reaches the destination end, the destined user is easily identifying the parameters like, from where the mail is coming like, public ip, machine name, and local ip address of the system which the mail is originated.. so i do not want to publisize such parameters to the outside world.. so how would i adjust the oulook such a way it should not take such parameters while sending the emails. i shal be thankfull if u help me on this! thanks in advance rizwan <> wrote in message news:#8ikqBqv...

Exchange Application Error
Event Type: Error Event Source: MSExchangeSA Event Category: General Event ID: 9153 Date: 5/24/2004 Time: 5:41:28 AM User: N/A Computer: DomainExchange Description: Microsoft Exchange System Attendant reported an error '0xc0072030' when setting DS notification. For more information, click Any insite would be appreciated? Regards, We need more information of your environment. Mixed? Exchange 5.5 and Exchange 2000? There are other events that come right before this that should give us more information also. These may be info...

help me #2
how to restrict entering of same values or data in excel cell Hi if you mean the 'preventing of duplicate entries' you may check the following site -- Regards Frank Kabel Frankfurt, Germany mangesh khati wrote: > how to restrict entering of same values or data in excel > cell ...

Net Worth Error
In Money 2007, I get an error when I try to look at my net worth. The error reads, "An error occurred, but Money is unable to retrieve and display details about what happend. (Resource = rcreport. Error = 2109.)" I ran the Standard File Repair but received a "No broken records in the original file." result. Any suggestions? Thank you. I had a similar problem with the monthly reports. Look at my post called "Troubleshooting method" that I wrote on 9/13/06, it might give you some ideas. Regards Bill Wood "T. J. Allard" <T. J. Allard@discu...

CRM 3.0 Invalid Association error when sending email
On a fresh CRM 3.0 installation I receive the error "Invalid Association. The request association is not valid" when we try to send an email. Anyone know about this? Thanks! Hi. I also have the "Invalid Association" error when sending email, did anyone find a resolution to this? Thanks in Advance. Dav "Troy" wrote: > On a fresh CRM 3.0 installation I receive the error "Invalid Association. The > request association is not valid" when we try to send an email. Anyone know > about this? Thanks! Reply to self - turned out to be the authe...

Receivables Aging Process Error
During processing Cash Receipts, we had a power failure at our offices. I am getting the following error when Aging Receivables: "Documents exist in a recovered batch or in an interrupted transaction-level posting session that have not been posted. If you continue, only the documents that have been posted will be included". Does anyone have an idea how we can troubleshoot this problem? Maria, Did you look in Batch Recovery? Is there anything in there? Have you tried running check links? -- Victoria Yudin GP MVP "Maria" <> wr...

1 email account, 2 mail address, 2 computers, Outlook 2000
Hi I have 1 email account, with is shared between me and my girlfreind, we each have our own email address, but all our mails go in to one joint inbox, using something called Email Alias, that our ISP use. The problem is that we get each others mails, and we would like to setup a rule so that the mails not intented for the person that recives them is automaticly deleted in his/her outlook and is left on the server so the other can get it when checking their mail. I have been looking for guides to do this for a while and have been able to find a few for Outlook 2002 and 2003, but none for th...

Install error
Our network guy reinstalled Windows 2000 on one of our workstations and left me to reinstall all the applications (which I've never done before). I finally found the cd for Microsoft Office 2002 that matched that particular machine (as he didn't label them) and followed the prompts to install. It said the install was successful, but Outlook wouldn't work. I put the cd back in and followed the prompts to just install Outlook. Still wouldn't work so I put the cd back and told it to reinstall. It said the reinstall was successful, but Outlook wouldn't work. So I put the...

Error in Subtotal Wizard (Grouping and Outlining)
I'm having trouble with Excel 2003 and the Subtotals Wizard. When I perform a three-level grouping on the data listed below, it appears that some groups are missing and outline levels 3, 4, and 5 are messed up. Given the following list of data: Region columnb Office Employee columne Issue NW SEA 123 Salary NW PDX 234 Benefits NW PDX 244 Salary NW PDX 212 Salary NW BOI 232 Benefits SW LAX 673 Salary SW LAX 34 Benefits SW LAX 654 Benefits SW PHX 556 Salary SW DEN 322 Benefits SW DEN 65 Salary ...

Error 1911
Dear all, I got error message "Error 1911. Setup cannot register type library for file c:\program files\microsoft office\office10\msacc.olb" when install Access XP. After installed, I can't view the module. Please tell me how to solve. Thanks. Chlaris ...

how do i superscript part of a cell in MS Excel? #2
When I use the superscript option after selecting just a portion of the cell, the superscript appears during edit mode only. How do I get it so it appears as superscript on the spreadsheet or when printing? Again, I'm only trying to superscript part of a cell's contents, not the entire cell. Did you hit enter have you applied the format change? And you can't do this kind of formatting to formulas or real numbers. It has to be text. If you do this a lot... John Walkenbach has a helpful addin that you may like: allan wrote: >...

Error 130
Hope someone can point me in the right direction. OSX 10.63, MacOffice 2008 12.2.4 When I try to connect to the following news server ( that doesn't require a user name or password ) I get the following error when attempting to download the List of Newsgroups: "Too many connections in your class - Could not receive the Newsgroup List - ERROR 130 " Any pointers much appreciated. Using Msnews servers works fine. -- Welsh Gas Remove usual to reply direct. paulatwoodsforddotcodotuk On 4/27/10 10:49 PM, in article 59bb7979.-1@webcrossing.JaKIaxP2ac0, "We...

cant open outlook #2
so when i first installed office 2007 on my computer a few months ago i tried setting up my email. it didnt work and now when ever i try to open outlook it says "Configuring Outlook Accouts" for about a minute then a window pops up saying "The connection to Microsoft Exchange server is unavailable. Outlook must be online or connected to complete this action" so i click "ok" and the window poops up asking for my Microsoft exchange server and my mailbox so i type in that info as far as i know its correct. and i get another popup saying "cannot open def...

Rounding question
I'm using Excel 2007 but 'save as' 97-2003 as colleagues have different versions. All number formats are set to 2 decimal places. I'm finding that percentage calculations are rounding up to 2 decimal places but when the result in currency is subtracted from another figure the sum is rounded down. This gives results such as 6 - 3 = 4. I'm sure there must be a simple answer but I can't find it. Hoping someone here knows, as checking all simple calcuations is getting ridiculous ! Carrie "Carrie" <> w...

Error Message on FormMailer
I have several form mailer pages set-up on my website in each page after the form is completed and submit is clicked, the results are sent to the correct address, but the screen dispalyes an error message. Below is that message Error Message User: please report details to this sirte's webmaster Webmaster: please see the server's application event log for more details This same form mailer set-up has worked on other sites that I've developed without the error message. Can anyone help point me to some sort of resolution for this problem. I'm currently having ...

multiple "reply" buttons & illegal operation error
using Outlook 2000 for MS Excange server config. when i open received mail, there are 2 reply buttons on the task bar. When I reply to email and send, "illegal operation" error comes up and Outlook shuts down. tried to uninstall and reinstall...but prob still there. tried to repair outlook...but prob still there. any ideas ...