1 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Why does `"">0` evaluate to TRUE?

I was noticing some funny business with conditional formatting, and traced it back to the fact that Excel thinks an empty string is greater than 0.

https://preview.redd.it/8odtmny4dz1h1.png?width=116&format=png&auto=webp&s=f24ca9f71b2ccb9cf15466c7754bd22994c75586

Naturally, my next thought is "How much bigger is "" than 0?", expecting some floating point error around zero or something, but `0-""` throws a #VALUE! error.

It's not comparing the lengths of the strings, either, because

"bar">"foo"=FALSE
"bar"<"foo"=TRUE

Is it comparing the binary representations of these strings as numbers or something? This seems weird!!!

submitted by /u/Ok-Difficulty-5357
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel compatibility
#Excel alternatives for data analysis
#Excel alternatives
#rows.com
#business intelligence tools
#row zero
#financial modeling with spreadsheets
#Excel
#conditional formatting
#empty string
#string comparison
#> 0
##VALUE! error
#floating point error
#weird behavior
#binary representation
#greater than
#less than
#length comparison
#data type