ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF formula and whole numbers (https://www.excelbanter.com/excel-discussion-misc-queries/48741-if-formula-whole-numbers.html)

jdmagoo

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


TheRobsterUK


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



All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com