Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jdmagoo
 
Posts: n/a
Default IF formula and whole numbers


With regards to an 'IF' formula, how do i get it to reconise whole
numbers only. For example, if the result was either 1,2,3,4,5,6.... the
answer would be true but if the result was either 1.5,2.7,3.2 etc and
not a whole number, then the answer would be false.
i can get it to recognise a single whole number but not multiple whole
numbers. I know there is a very simple answer to this but i am new to
this game.

Many Thanks

James


--
jdmagoo
------------------------------------------------------------------------
jdmagoo's Profile: http://www.excelforum.com/member.php...o&userid=27814
View this thread: http://www.excelforum.com/showthread...hreadid=473425

  #2   Report Post  
TheRobsterUK
 
Posts: n/a
Default


If the number you want to assess is in cell A1:


Code:
--------------------
=IF(MOD(A1,1)=0, TRUE, FALSE)
--------------------


Divides the contents of cell A1 by 1 (MOD(A1,1)) and if the remainder
is zero then the value must be an integer, so return TRUE, else return
FALSE.


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=473425

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"