Simple Excel Calculation..

Why doesn't one of these formulas in attached spreadsheet columns B,C,D,E give me an answer of $.75?  Not sure I understand why the $.750000000000002...  What am I missing?  Thanks.
EE.xlsx
LVL 7
tomfarrarAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SeanSystem EngineerCommented:
Adjust your cell formatting to only display the .75
0
tomfarrarAuthor Commented:
It is not just formatting.  I need the number to be exactly $.75
0
NorieAnalyst Assistant Commented:
Try =ROUND(B2-B3,2) etc.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Rob HensonFinance AnalystCommented:
Its all to do with Excel's built in level of accuracy; It will only calculate to 15 significant places.

However, that doesn't help explain why two hard-coded (as opposed to calculated) numbers that are only 3/4 significant figures (2 before decimal and 2 after decimal) subsequently create a 15th significant figure, the 2 at the very end.
0
ShumsExcel & VBA ExpertCommented:
Try:
=ROUNDDOWN(B2-B3,2)

Open in new window

0
NorieAnalyst Assistant Commented:
This is a problem caused by the internal representation of floating point numbers, which uses a fixed number of binary digits to represent a decimal number.

Some decimal numbers can't be represented exactly in binary, resulting in small roundoff errors.

PS It's not just Excel.:)
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Paul SauvéRetiredCommented:
Why doesn't one of these formulas in attached spreadsheet columns B,C,D,E give me an answer of $.75?  Not sure I understand why the $.750000000000002...  What am I missing?  Thanks.

select the cells and use the number format Currency―problem solved
EE_currrency.xlsx
1
pcelbaCommented:
The inaccuracy is caused by underlying data type which is "double" for the standard number. Double uses binary representation in 64 bits split between mantissa and exponent and the important thing is not all decimal numbers do have exact conversion to binary representation. Some (for us) simple numbers containing fractional part are converted to periodic binary number so certain rounding must happen.

Currency data type uses big integer (64 bits) with emulated 4 decimals obviously. So the accuracy is ensured if the 4 decimal places are enough. I am not sure whether Excel uses currency data type or just rounds the values.

Many programming languages and database engines (and some CPUs) use decimal data type which calculates and stores the decimal representation of the number without any conversion. Such data type cannot loose accuracy the same way as double. Of course calculations are much slower when used CPU does not support decimal data type.

Update: Sorry, the first paragraph was explained by Norie already.
0
tomfarrarAuthor Commented:
There were good thoughts by all, but Norie was first and most concise.  Thank you all.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.