The same monthly CSV imports with half the dates as text and half silently swapped day and month — how do I stop guessing?
I get a CSV from someone else's system on the first of every month. The date column comes in as something like 03/07/2026.
What happens on import is the worst possible outcome: some rows become real dates, some stay as text left-aligned in the cell, and — this is the part that actually cost me — some of the ones that converted are wrong. The third of July has become the seventh of March, and it only did that for the days where both numbers were twelve or under, so anything after the twelfth stayed correct.
I caught it because a total looked wrong for one month. I have no idea how many earlier reports were affected.
How do people handle this properly? I would like a method rather than the find-and-replace I have been doing.
@power_query_pinar · 6h ago
Fix it in the import step, where you can state the format explicitly instead of hoping.
In Excel: do not open the CSV. Use Data → Get Data → From Text/CSV, which opens a preview where you set the type of each column, and critically lets you choose Using Locale on the date column so you can say "this data is day-first" regardless of what your machine is set to. That single dropdown is the whole fix. Once the query is saved, next month is a refresh and it parses identically — which also solves the real problem, that this is a recurring file and a manual fix has to be done correctly every time forever.
In Google Sheets: File → Import and turn off automatic type conversion, so everything arrives as text and nothing has been guessed. Then convert deliberately with a formula — pull the parts out with SPLIT or the text functions and reassemble with DATE(year, month, day), where you are the one deciding which part is which. Verbose, and it cannot be wrong.
Either way the principle is the same and it is the general lesson: parse explicitly, or arrive as text and convert deliberately. Automatic conversion of ambiguous input is convenient right up until it is silently wrong, and there is no way to audit it afterwards.
Reply
Report