Description: IF A1=10.5G,A2=10.2C =IF(LEFT(A1,4)>LEFT(A2,3))=True A1=10.5G,A2=9.7C =IF(LEFT(A1,4)>LEFT(A2,3))=False It seems that difference of number of characters would make formula IF & LEFT go wrong, and formula RIGHT is as well. Steps to Reproduce: 1. Assume A1=10.5G,A2=9.7C 2. Formula IF(LEFT(A1,4)>LEFT(A2,3))=False 3. Actual Results: FALSE Expected Results: TRUE Reproducible: Always User Profile Reset: No Additional Info: please check the formula IF & LEFT
=LEFT(A1;4) => 10.5 (string) =LEFT(A2;3) => 10. (string) =LEFT(A1;4)>LEFT(A2;3) => TRUE =IF(LEFT(A1;4)>LEFT(A2;3)) => TRUE =IF(LEFT(A1;4)>LEFT(A2;3))=FALSE => FALSE Of course, this is correct and not a bug.
There's no conflict here. You are comparing strings, not numbers; they are compared lexicographically. When you compare string "10.5" to string "10.2", the latter is lexicographically before the former (its all but last characters are same, and last character in the latter is alphabetically before the one in the former). When you compare "abcd" to "abca", the latter is lexicographically before the former, for the same reason. When comparing "10.5" to "9.7", the latter is lexicographically after the former: they start from different characters, and that character defined the order. When you compare "abcd" to "xyz", the latter is lexicographically after the former, for the same reason. You need to use something like VALUE(LEFT(A1,4)) Closing NOTABUG.
Oh, and for your varying test case (confusingly only in the repro steps) it is =LEFT(A1;4) => 10.5 (string) =LEFT(A2;3) => 9.7 (string) =LEFT(A1;4)>LEFT(A2;3) => FALSE =IF(LEFT(A1;4)>LEFT(A2;3)) => FALSE =IF(LEFT(A1;4)>LEFT(A2;3))=FALSE => TRUE Because operator '>' there does a string comparison where 9>1, not numeric. So, also correct and also not what you claim it was. If you want numeric comparison, use =NUMBERVALUE(LEFT(A1;4);".")>NUMBERVALUE(LEFT(A2;3);".")