Decimal Places

staceyd

Board Regular
Joined
Oct 23, 2002
Messages
84
Try the following:
Enter 10.2 in cell A1
Enter 10 in cell B1
Enter the formula A1-B1 into C1.
Format cell C1 to 15 decimal places.

Why is the answer 0.199999999999999 and not 0.2

(Where did the 0.000000000000001 go?)
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

staceyd

Board Regular
Joined
Oct 23, 2002
Messages
84
Sorry, but I beg to differ...

10.2 - 10.0 = 0.2 .....

How can 0.2 be rounded down to 0.1999999999999999???
 

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
It is showing the .19999999999whatever because it has the necessary decimal places to do so. That is still the correct answer for subtracting those two numbers.

If you set it to only two decimals, it will show .2, because it simply rounded it up from .1999999999999999999 as it can't show all of that.

It also only does that if you go to 15+ decimals. If you change it to 14, it shows 0.2000000000.

Make any sense?

_________________<font color="#3399FF" size="3">Kristy</font>
kitten_smush2.jpg

This message was edited by Von Pookie on 2002-10-24 12:12
 

Forum statistics

Threads
1,181,095
Messages
5,928,045
Members
436,585
Latest member
Skyndt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top