+ Reply to Thread
Results 1 to 5 of 5

Wrong division operation result in VBA

  1. #1
    Registered User
    Join Date
    04-21-2010
    Location
    Bursa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Wrong division operation result in VBA

    Hi folks!
    I have a strange problem..
    I am using Office 2007 Excel (VBA). I am trying to do this operation:
    Please Login or Register  to view this content.
    It gives me this result: 4,26325088339223E-02. However, when I do the same operation using Windows calculator or a normal calculator, it gives me this result: 0,04263250883392226148... Actually I can get the same result on VBA, dividing the result by 100 but I don't want to do that as it sometimes gives different results.
    Any help would really be appreciated. Thanks in advance!

  2. #2
    Registered User
    Join Date
    08-13-2012
    Location
    Czech Republic
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    7

    Re: Wrong division operation result in VBA

    this numbers are almost equals, difference is 9.71E-17
    All your base are belong to us

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Wrong division operation result in VBA

    Hi illkaygumus,

    Welcome to the forum!!

    The answer is correct, but just not formatted in your expected format. Use this which will display the answer to 6 decimal places (change the number of zeros to suit):

    Please Login or Register  to view this content.
    HTH

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Registered User
    Join Date
    04-21-2010
    Location
    Bursa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Wrong division operation result in VBA

    You are a life-saver Robert! Thank you so much!
    Thanks to you too, LadiskoCZ!

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Wrong division operation result in VBA

    @ ilkaygumus

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1