# Why is a cell reading as 0.80000001 when it should be 0.8?

##### New Member
I have a formula that is doing a simple subtraction between two cells. The result of this is being used in a Index(Match) function, but I am sometimes pulling an error because the cell seems to be reading as 0.800000000000001 instead of 0.8. The subtraction in question is just essentially 10.8 - 10. I checked that there are no hidden decimals in the 10.8 and the 10, and there are not.

Any ideas why this is occurring and what I can do to fix this?

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Computers work in binary, not decimal, so it's as close to .8 as it can get using subtraction in binary.
You can get around this by using the ROUND function, something like =ROUND(A1-A2,3)

I have a formula that is doing a simple subtraction between two cells. The result of this is being used in a Index(Match) function, but I am sometimes pulling an error because the cell seems to be reading as 0.800000000000001 instead of 0.8. The subtraction in question is just essentially 10.8 - 10. I checked that there are no hidden decimals in the 10.8 and the 10, and there are not.

Any ideas why this is occurring and what I can do to fix this?

Look up on floating point maths, etc.

In the meantime use, something like:

MATCH(TRUNC(A1*10)/10,MatchRange,MatchType)

Replies
3
Views
411
Replies
7
Views
518
Replies
2
Views
488
Replies
2
Views
879
Replies
4
Views
2K

1,203,515
Messages
6,055,844
Members
444,828
Latest member
StaffordStag

### 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.

### Which adblocker are you using?

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

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