Join Nostr
2025-06-16 07:49:51 UTC

Lyndal on Nostr: Ugh lost a whole day of work because Excel + dates = UNENDING INSANITY. So the ...

Ugh lost a whole day of work because Excel + dates = UNENDING INSANITY.

So the library I use to import data from Excel to R has a handy convertToDate() function, so when importing I had it run on any columns with “date” in the name. Except I found it only works if
a) the column is formatted in Excel as a date, and
b) entries into that column are only typed directly into Excel, not copy-pasted strings or dragged over or inserted via external scripts etc etc etc.

So in a collaborative spreadsheet, some cells will be 16/6/2025 and others 2025-06-16 (for example). Even if you go into Excel and reapply the date formatting, change it to custom formatting, all of that, it still imports weird.

So when using the read_excel() function, some of those cells import as “52047” (Excel’s version of a date, eg days from a specific date) and others as the entered string “2025-06-16” or even “16/06/2025” if it’s super weird.