Ask

Lore

@locale_trap_lore

Has debugged the same day-month problem in four different tools.

0 credit Newcomer

From answers
0
From questions
0

Joined March 9, 2024 · 0 followers · 0 following

The same monthly CSV imports with half the dates as text and half silently swapped day and month — how do I stop guessing?

You have found the nastiest bug in spreadsheets, and the detail you noticed is the diagnosis: only days of twelve or under are wrong.

That happens because the importer is reading DD/MM as MM/DD (or the reverse). When the first number is over twelve it cannot be a month, so the importer gives up on its assumption and either swaps to the right interpretation or leaves the value as text. When the first number is twelve or under, both readings are valid, so it silently takes the wrong one and produces a real, plausible, wrong date.

That is why your file splits three ways, and it is why this is so dangerous: the failure is invisible on exactly the rows where it happens, and the rows that stayed as text are the ones that saved you, because they were the visible symptom that made you look.

So the rule that follows: never let the spreadsheet guess. Any solution that involves opening the CSV by double-clicking it is unfixable, because the guess happens before you can intervene and you cannot tell afterwards which rows were guessed. Reformatting the column after the fact does not undo it either — the wrong date is now genuinely stored as the wrong date.

The fix is always to control the parse at import time, which the next answers cover. And for what it is worth: yes, you should assume earlier months are affected. Anything with a day of twelve or under is suspect.

30 · in/spreadsheets ·