any text is larger than largest number
I'm sure the OP knows that. I interpret the point of his/her posting to
mean: why did Excel choose to do it that way? Why isn't text always less
than a number? Why doesn't "12">37 give the same result as "12"-37>0?
For the latter, the answer is: numeric strings are "converted" to numbers
in numeric expression. The question is: why aren't numeric strings
converted to numbers in the first case as well? Or why isn't the number
37
treated as a string, and a string comparison performed?
The reason, I think, has to do with the underlying logic built into the
language by the programmer for handling comparison operators. As you
mentioned, for numerical expressions, the strings are converted to numbers
before the operation takes place. Why? Because you can't perform numerical
operations on strings, so the underlying logic tries to force all operands
to be numeric and raises an error if that can't be done. Now, comparisons
are a different story... you can check to see if "ABD" is greater than "ABC"
as well as if 123 is greater than 89. The underlying logic for comparisons
seems to be... if the two operands are numbers, then a numerical comparison
results; otherwise a string comparison takes place. This allows the
underlying code to skip over error checking for mis-matched operands (an
apparent programming choice made by the creators of Excel)... if one operand
is a string, then both are compared as strings. Why? There is really no way
for the program to "know" which type of comparison you really wanted if one
is a string representation of a number and the other is an actual number, so
it assumes for all cases, no matter what the operands are, if one of them is
a deliberately provided to the comparison as a string, then the Excel user
probably wanted to do a string comparison. If that is not what the
programmer wanted, then he/she has conversion functions that can used on the
operands to force a numerical comparison. This gives the Excel user the
maximum flexibility without having to deal with "extra" errors. Anyway, that
is how I make sense of it all.