Excel IF condition with comma

Solved
informatifien Posted messages 781 Status Member -  
informatifien Posted messages 781 Status Member -
Hello hello,

Here's just a quick question, is there a formula to say if A1 has a number after the decimal point then display 1?

Basically, I display numbers which will either be or not be 0.5, if so I would like 1 in A2, if not I would like 0, I tried this: =IF(A1="#,5",1,0) but it shows 0, I think there's a syntax problem with the 0.5...

If anyone has an idea.

Thanks in advance

--
THANK YOU TO CCM FOR DECLARING PUBLIC INTEREST SOURCE... PLEASE MARK YOUR RESOLVED TOPICS WHEN IT'S THE CASE...
Configuration: asus P5V800 / P4 2.8 Ghz / 1.5 Go Windows XP FireFox / IE 7

2 answers

  1. gbinforme Posted messages 14930 Registration date   Status Contributor Last intervention   4 744
     
    Hello

    You can't do it with your formula because you're using a format and not a value, but you have plenty of other options.

    =IF(A1-INT(A1)=0,0,1) or =IF(MOD(A1,1)=0,0,1) or =IF(A1=INT(A1),0,1) or =IF(MOD(A1,1),1,0)

    for example

    You might not need your column because you can then write

    =IF(MOD(A1,1),"decimal","integer")

    --

    Always zen
    2