Why Excel is not precise on a simple decimal subtraction?

Budana P 0 Reputation points
2023-03-03T08:07:11.5066667+00:00

Is there a precise way to subtract 9.051968 and 9.051967 and get exactly 0.000001? If I increase the decimals in the result cell, the answer is a not precise 0.00000100000000102796. I am using Microsoft® Excel® 2016 MSO (Version 2301 Build 16.0.16026.20196) 64-bit. Thanks for any insights & tips.

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,479 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,694 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Emi Zhang-MSFT 23,906 Reputation points Microsoft Vendor
    2023-03-06T06:14:26.11+00:00

    Hi @Budana P,

    You can use the formula to help you get the result:

    =ROUND(A1-A2,6)

    User's image

    You can read this article about the Floating-point arithmetic in Excel:

    https://learn.microsoft.com/en-us/office/troubleshoot/excel/floating-point-arithmetic-inaccurate-result

    Hope it's helpful.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments