Forum Discussion

kieranmac's avatar
kieranmac
Copper Contributor
Jan 13, 2024

if statement seems reversed

I am using if statements and it seems to be outputting the reverse of what is correct.    eg:   =if(10>60,1,0) gives me a true value of 1   it seems like it is always showing true no matter wha...
  • Riny_van_Eekelen's avatar
    Jan 13, 2024

    kieranmac Long story short. G2 contains a text based on what I guess a formula like =LEFT(E2,2).

    A text is always considered greater than a number. That's why you will always get 1.

     

    You have two options.

    1) change the formula in G2 to =LEFT(E2,2)*1 or =--LEFT(E2,2). Both these will turn the result into the number 10 and your IF formula will work.

    2) change the IF formula to =IF(C4>"60",1,0), in case you really want to compare texts.

Resources