INT Function not working

ssalazarjr

Board Regular
Joined
Jun 1, 2009
Messages
158
I'm getting a FALSE when entering this formula.

A2=$789.14
B2=$ 3.14

=(A2-INT(A2))=(B2-INT(B2))

When I evaluate the formula I get notice:

=(.1399999999986)=(B2-INT(B2))

=(.1399999999986)=(.14)

I've know its not a decimal place issue, because I'm entering the amounts myself. I put exactly 789.14.

I also tried =MOD(A2,1)=MOD(B2,1) and it does the same thing.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
It has to do with the floating point decimal system that Excel uses. A way around it is to use the ROUND function as well... try:

=ROUND((A2-INT(A2)),2)=ROUND((B2-INT(B2)),2)
 

ssalazarjr

Board Regular
Joined
Jun 1, 2009
Messages
158
Hey thanks for your reply.

I googled the "floating point decimal system" (thanks to your reply) and found their is a way to deactivate it.

  1. Click Microsoft Office Button -> Excel Options -> Advanced
  2. Scroll down to "When calculating this workbook" section
  3. Check "Set precision as displayed"
Do see any problems with doing it that way?
 

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
If you have any calculations that need to be more accurate, then unticking that option can cause things to go awry.
 

ssalazarjr

Board Regular
Joined
Jun 1, 2009
Messages
158
I'll just add the ROUND function, as you suggested, just to be safe.

Thanks for you help!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,017
Messages
5,834,960
Members
430,330
Latest member
drAli77

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