Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why comparing text in google sheets returns true and false?

I have this Google Sheets table with input1 and input2 and curiously, comparing the text, the output returned TRUE and FALSE ! How is the output determined?

Does Google Sheets like dogs more than cats?

Input1 Input2 Output FORMULATEXT
Cat Dog FALSE =A2>B2
Dog Cat TRUE =A3>B3
Dog Dog FALSE =A4>B4
Dog Dog FALSE =A5>B5
Cat Cat FALSE =A6>B6
Cat Dog FALSE =A7>B7
Dog Cat TRUE =A8>B8
Dog Cat TRUE =A9>B9
Dog Cat TRUE =A10>B10
Cat Dog FALSE =A11>B11

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Each character is checked against another, one by one.

In case of Dog vs Cat, the first character is checked and if it is greater based on (Which maybe based on CODE), returns TRUE and no more checking is performed. If however, they’re both the same character, next character is taken and compared: Dog>Dng. Here, D is the same, so o is compared against n and if they’re equal, goes to the next character and so on.

All the code of characters isn’t summed. For eg,

="D">"CZZZZZ"

will always return true regardless of the number of Z after the first C, because D is greater than C

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading