Archive of Mr Excel Message Board

Back to Forms in Excel VBA archive index
Back to archive home

Is there a 'IsInteger' function?
Posted by Thomas Liao on July 17, 2001 11:09 AM
Hi there,
I need a function to distinguish if the result is an integer, something like the 'if' funcion.
How do I write down the code for this IsInteger function?
Example:
If(IsInteger(a1/b1*c1),x,y)
Thank you

| Check out our Excel Resources
|
 |
 |
Re: Is there a 'IsInteger' function?
Posted by Mark W. on July 17, 2001 11:29 AM
=IF(NOT(MOD(A1/B1*C1,1)),...)

Re: Is there a 'IsInteger' function?
Posted by Aladin Akyurek on July 17, 2001 11:31 AM
Thomas,
There isn't an ISINT function in Excel, but you can embed something like the following in the formulas that you use:
=IF(A1-INT(A1)>0,0,1)
It returns 1 if A1 is an integer. Or a formula that returns a logical value:
=A1-INT(A1)>0
An alternative would be to sollicite for a UDF (user Defined Function) at this board.
Aladin
============

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.