+ Reply to Thread
Results 1 to 6 of 6

excel formula not returns to right value

Hybrid View

  1. #1
    Registered User
    Join Date
    04-20-2024
    Location
    Malaysia
    MS-Off Ver
    Microsoft Office Home
    Posts
    3

    Post excel formula not returns to right value

    Hello Guys

    I have a problem with my Excel. I just recognize this error a few days ago

    When I do the calculation by using the formula, the answer is not return to the right value. Please ref to below example

    I made simple calculation

    100+0.3 with simple formula and the answer is 100.3 ...when I paste as value the answer is 100.30
    However when I do the reverse.. 100.30-100.00, the answer become 0.299999999999997. Why its not return to 0.3?


    100.0000000000000000 0.3000000000000000
    100.3000000000000000 0.2999999999999970
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,800

    Re: excel formula not returns to right value

    Google: Microsoft Excel floating point error and read all about it.

    Try this:

    =ROUND(C6-C5,1)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-20-2024
    Location
    Malaysia
    MS-Off Ver
    Microsoft Office Home
    Posts
    3

    Re: excel formula not returns to right value

    Thank You AliGW

    when I search at google.. I found how to resolve my problem

    "How do I fix floating point error in Excel?
    On the File tab, click Options, Advanced, scroll down to 'When calculating this workbook', and check 'Set precision as displayed'. This feature forces numbers to be as precise as they appear on your worksheet."

  4. #4
    Registered User
    Join Date
    04-20-2024
    Location
    Malaysia
    MS-Off Ver
    Microsoft Office Home
    Posts
    3

    Re: excel formula not returns to right value

    Quote Originally Posted by AliGW View Post
    Google: Microsoft Excel floating point error and read all about it.

    Try this:

    =ROUND(C6-C5,1)

    Thank You AliGW

    when I search at google.. I found how to resolve my problem

    "How do I fix floating point error in Excel?
    On the File tab, click Options, Advanced, scroll down to 'When calculating this workbook', and check 'Set precision as displayed'. This feature forces numbers to be as precise as they appear on your worksheet."

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,515

    Re: excel formula not returns to right value

    Setting precision as displayed is usually not the best solution for floating point errors. A better solution is to use ROUND() functions or other programming strategies for dealing with floating point errors.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,946

    Re: excel formula not returns to right value

    Probably not a good idea.

    j.e. mcgimpsey
    January 8, 2012 at 3:35 pm | #
    Your example demonstrates a common fundamental misunderstanding of Excel – changing the displayed number of digits doesn’t do anything to the stored value which is used in calculations.

    Setting Precision as Displayed is usually a REALLY bad idea – since XL will actually change the values you enter, unless you set up your workbook very carefully, you’ll never know where the precision was lost. You’re usually much better off using the ROUND() function, e.g.: =ROUND(A1,2) + ROUND(A2, 2), which at least hints at where potential inaccuracies may creep in. Your hypothetical accountant will never be able to find out why he’s one off if the base data is permanently lost.
    See: https://www.dustinwheelercpa.com/201...played-option/
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel SUM Formula Is Not Working and Returns 0
    By mutedf8 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-23-2022, 12:10 PM
  2. Excel formula returns 000 on one computer while rest return expected value
    By sknalodz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-08-2020, 04:00 AM
  3. Excel Formula that only returns less than 5 working days from today()
    By williamthomp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2018, 10:56 AM
  4. [SOLVED] Excel 2010 - SUM formula returns incorrect result
    By digita in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-15-2016, 01:06 AM
  5. Excel 2007 formula returns negative numbers
    By bensonsb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-06-2012, 09:15 PM
  6. Excel 2007 : Excel IF formula with multiple returns
    By sixstringirl in forum Excel General
    Replies: 8
    Last Post: 03-29-2011, 01:38 AM
  7. Replies: 2
    Last Post: 12-20-2007, 06:15 PM

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