ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to diferentiate integers with decimals in the IF formulas (https://www.excelbanter.com/excel-worksheet-functions/55862-how-diferentiate-integers-decimals-if-formulas.html)

decimal seperator

how to diferentiate integers with decimals in the IF formulas
 


[email protected]

how to diferentiate integers with decimals in the IF formulas
 
decimal seperator wrote:
Subject: how to diferentiate integers with decimals in the IF formulas


I think your question is: how to recognize integral numbers.
One answer:

=IF(INT(A1) = A1, "integral number", "non-integral number")

Caveat: If A1 is the result of a formula that involves non-integral
numbers, the result might appear to be an integral number in
the cell, but it really is not. In that case, it might be better to
write:

=IF(ABS(A1-INT(A1)) < 1E-6, "integral number", "non-integral number")

where you might choose something other than 1E-6, depending
on your tolerance or cell format.

Alternatively, you might set the option Tools Options
Calculation Percision as Displayed. But that might have
unexpected consequences.

Etiquette note: In the future, always include text in your
message, even if it simply repeats the subject line. Some
newsgroup readers do not show the entire subject line.
Some newsgroup readers do not permit replies to postings
with null text(!).



All times are GMT +1. The time now is 09:18 AM.

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