Hacker News new | ask | show | jobs
by criddell 440 days ago
I've never understood why they don't let you turn off automatic date parsing. That one feature has caused me more grief than anything else in Excel.
4 comments

This is supported in Excel. Select options > Data > Automatic Data Conversions > untick the boxes.
Fun fact: This setting is only available since End of 2023 [0]

[0] https://techcommunity.microsoft.com/blog/microsoft365insider...

It's not working for me. I have those all unticked but if I create a new file and go to cell A1 and type 1/2, it puts 2-Jan in the cell rather than the text I want.

If I then put 60/100 in cell A2, it doesn't do any conversion. Then put the formula "=Search("/", A1)" in cell B1 and copy that to cell B2, B1 evaluates to #VALUE! and B2 evaluates to 3.

If you want the text "1/2" you should type '1/2

If you want the value one-half you should type =1/2

Not sure why this is controversial, Excel obviously has a syntax that's not focused on reproducing literal text.

You're not responding to the part where parent says the result is not 1/2 as in 0.5 but 2-Jan. The boobytrapped date parsing appears to be still happening even with "Automatic Data Conversions" disabled.
I understood that 1/2 converts to 2-Jan (or 1-Feb depending on settings).

That is desired behaviour. If you want the string 1/2 you need to use an apostrophe. If you want the fraction one half you need to use an equals sign. Both of these are vastly less likely to be what a user wants than the date interpretation, so it makes sense for that to be the default.

The parent posters discuss a menu option to turn off this automatic date parsing.
How does it then work if I send the file to others. Is it saved in the file or will it just crash there?
Not sure about an Excel workbook file like xlsx but for something like a CSV there is no way to attach that preference to the file so Excel will continue to mangle data as it always has unless everyone who touches it updates their settings.
IIRC, conversion to date happens after editing the cell value.
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.
It's not a setting which determines how a value stored in a sheet is interpreted. It's a setting which determines how inputs are interpreted before being stored.

When you type eg "4/4", "4-Apr", "2025-04-04" or whatever, it is converted to a number based on your local date format. The cell has a date format applied to it so that the number appears as a date. If you send the sheet to someone else, it will display the same numeric value, using their settings to display it as a date.

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.
More like I wrote some python code, and want to ensure the IDE doesn't change spaces to tabs. Night theme vs day theme is orthogonal to the code. Date parsing in Excel is not.
hm i mean, python doesn't really care about indentation kind, as long as it's consistent...

maybe writing a Makefile (which afaik really REALLY wants tabs), and want to ensure someone's IDE doesn't change it to spaces.

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.
I just tested it. The setting applies on data entry but opening a CSV or similar delimited file counts as “data entry”. So if you work strictly with xlsx files you are fine but it will irreversibly convert the values on open for delimited files unless you change the defaults.
Come on, there is no room for anyone to have a preference here when an excel document is meant to be storing the names of genes and would never need to have a date or time in it, and can very easily get corrupted beyond repair if someone turns date conversion on. (For context, genome research is the whole reason this toggle was added in the first place.) Even something like Vim lets you enforce file-specific settings with a header.

At the same time, we're clearly shooting ourselves in the foot by using Excel for this. This feature is just a hodge-podge solution to the problem of Excel not having strict data types. There should be enough cautionary tales (https://eusprig.org/research-info/horror-stories/) for everyone to know to avoid Excel.

The setting only applies when you enter or edit a value. It doesn't convert values which are already stored in a cell.
Yeah... a slow burn that is difficult to notice until it's too late.
Or at least have the option to disable any auto-"correct"...

https://www.theverge.com/2020/8/6/21355674/human-genes-renam...

Even worse is converting all numeric-looking strings to numbers, even if it requires truncation. If you use long strings of digits as identifiers, such as in billing systems, the actual transaction identifier will be mangled by Excel.
Meanwhile every time I import a CSV into LibreOffice I can't work out how to make it interpret my dates as actual dates.
If it provides any comfort, Excel in turn is unable to properly open/save a CSV with the separator being a comma (!) unless the regional settings of Windows are not defining it as such.

On german systems it's for example a semicolon, so a CSV is basically a "semicolon separated value" file, and there is no working solution around that...

How do you make a comma seperated CSV with numbers with commas in them?
A comma separated CSV with decimal numbers uses a dot as a decimal point (US regional setting)

A German CSV uses a semicolon as a separator and a comma as a decimal point (German regional setting)

To create a US-style CSV on a German PC (with expectation to create a common CSV format) you need to change the regional setting of Windows before opening Excel...

The standard way is to wrap the field in quotes.
you don't. use SQLite instead