Live data from Hacker News

Cursed Excel: "1/2"+1=45660

quadratichq.com

121–130 of 144 posts

Re: Cursed Excel: "1/2"+1=45660

#121
post #78

Earlier quoted context omitted.

If I type in 1/2, that means 1 divided by 2, or 0.5. If I then type +1, that means add 1. 1/2 I should never mean any kind of date, unless I'm entering it into a field that has already been declared a date field, or I have written that, then declared the field to be a date field.

I think most people that enter `1/2` in a spreadsheet do indeed mean `January 2nd` and not `0.5`. In the wider world of people using spreadsheets, dates are certainly more common than fractions.

You're right about that, but maybe it should just treat '1/2' as '1/2' and only convert it if it makes sense for the current operation. If I type 1/2 and I want the date, then I want 1/2, not Feb 1, or Jan 2, or 01/02/2025, or 2025-02-01, unless again, I have explicitly specified that this cell is a date, and this is the format I want it in.

Re: Cursed Excel: "1/2"+1=45660

#122

Earlier quoted context omitted.

An answer where? Not sure I follow

I just wanted to introduce "1/21" as an answer

Ahh I see the confusion now. I suggested it in the comment you were replying to:

> “1/2” concatenates with “1”

…and thought you’d spotted that and was saying others had disagreed with the concatenation way of handling + operators with strings.

Re: Cursed Excel: "1/2"+1=45660

#123

Earlier quoted context omitted.

I just wanted to introduce "1/21" as an answer

Ahh I see the confusion now. I suggested it in the comment you were replying to: > “1/2” concatenates with “1” …and thought you’d spotted that and was saying others had disagreed with the concatenation way of handling + operators with strings.

"“1/2” concatenates with “1”" != "1/21"

Re: Cursed Excel: "1/2"+1=45660

#124

Earlier quoted context omitted.

Ahh I see the confusion now. I suggested it in the comment you were replying to: > “1/2” concatenates with “1” …and thought you’d spotted that and was saying others had disagreed with the concatenation way of handling + operators with strings.

"“1/2” concatenates with “1”" != "1/21"

That’s literally what concatenation is.

Re: Cursed Excel: "1/2"+1=45660

#125

Earlier quoted context omitted.

"“1/2” concatenates with “1”" != "1/21"

That’s literally what concatenation is.

> Concatenate is a process of combining two or more strings into a single larger string. It's an important function in programming and computing because it allows you to store and combine multiple pieces of data when needed.

https://www.lenovo.com/us/en/glossary/concatenate/#:~:text=C...

That doesn't make those two strings equal, however.

Re: Cursed Excel: "1/2"+1=45660

#126

Earlier quoted context omitted.

That’s literally what concatenation is.

> Concatenate is a process of combining two or more strings into a single larger string. It's an important function in programming and computing because it allows you to store and combine multiple pieces of data when needed. https://www.lenovo.com/us/en/glossary/concatenate/#:~:text=C... That doesn't make those two strings equal, however.

Im not using the term in any weird way here. JavaScript even has a function specifically called “concat” and the ‘cat’ utility in UNIX is short for “concatenation”

You can try string concatenation in 3 differently languages using the links below:

https://www.w3schools.com/python/python_strings_concatenate....

https://go.dev/play/p/Q5VPF2ANk7Y

https://www.w3schools.com/jsref/jsref_concat_string.asp

Edit: who said anything about making both side of the operator equal? That’s not how operators work.

Re: Cursed Excel: "1/2"+1=45660

#127

Earlier quoted context omitted.

No, but I think it's a lot. I'd bet that the vast majority of those round-trip through string serialization, requiring no further user action based on my recommendation.

Disagree, the most common way for an experienced user to type a date into Excel is as a partial date if it is this year, eg 4-Apr, which is instantly converted to 04/04/2025 or whatever. The vast majority of dates I personally type into Excel would be in this form.

Format the column as date. Or turn on the global option for loose type insanity.

Re: Cursed Excel: "1/2"+1=45660

#128

I'm not sure why this is FP news. I knew "1/2" was being interpreted as "January 2" as soon as I saw the title. This is nothing new, or even particularly interesting -- Excel (and Sheets) have been doing this date conversion from the beginning. This is just an ad for Quadratic, nothing more.

It explains why the result is the particular value it is, which depends on the date serial number mechanism Excel uses and the mistaken 1900 leap year. I learned something, personally. Also, WRT the idea that “everyone knows” Excel will treat 1/2 as a date… https://xkcd.com/1053/

Re: Cursed Excel: "1/2"+1=45660

#129
post #32
post #23

Earlier quoted context omitted.

The others may have their own preferences to edit documents. It's like you edited one code file in a project, and you want everyone to switch to night IDE theme when they open that particular file.

The meaning of a value (data type in programming lingo) is not a preference because it is objective, not subjective. It depends on the cell being displayed, not on the viewer in front of the screen.

But GP isn't talking about value, they are talking about process of entering the value, so that _their_ editor (Excel) wouldn't convert it to something weird.

Re: Cursed Excel: "1/2"+1=45660

#130
post #86
post #23

Earlier quoted context omitted.

The others may have their own preferences to edit documents. It's like you edited one code file in a project, and you want everyone to switch to night IDE theme when they open that particular file.

Well, no, it isn't because Excel actually changes the underlying data too. It's more like changing the formatting of all the files in the project and deleting all the characters after the 80th column.

Does it? I think it only affects when you enter the value, it doesn't change the underlying data that someone else stored in a doc.
Post reply on HN