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.
 

Some videos you may like

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

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!
 

Watch MrExcel Video

Forum statistics

Threads
1,109,001
Messages
5,526,203
Members
409,686
Latest member
Tori83

This Week's Hot Topics

Top