Strange results

qjsbarrick

New Member
Joined
Aug 13, 2010
Messages
14
When I type in A1 152.2 and in B1 152.6 then C1 = B1-A1 I get the result 4.0 if I expand the number of decimal places I get <table style="border-collapse: collapse; width: 161pt;" width="214" border="0" cellpadding="0" cellspacing="0"><col style="width: 161pt;" width="214"><tr style="height: 15pt;" height="20"> <td class="xl63" style="height: 15pt; width: 161pt;" width="214" align="right" height="20">0.4000000000000060000</td> </tr></table> If I then enter the following formula in D1

=IF(B1-A1=0.4,"True","False")

I get the result False.

Can someone please explain this.

Thanks

Quentin
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Thanks Armando Montes and Boller for the explanations.
It seems to be a larger problem not only in Excel but also in my SQL calculations. I have used the ROUND() function to set the number of decimal places to 2 and it all seems OK at this stage. Something to remeber in the future.

Thanks
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,504
Members
452,917
Latest member
MrsMSalt

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
Back
Top