Back to Forms in Excel VBA archive index

Back to archive home

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)

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 | ||||

=IF(NOT(MOD(A1/B1*C1,1)),...)

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.

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.