{"id":1016,"date":"2026-10-23T17:31:50","date_gmt":"2026-10-23T17:31:50","guid":{"rendered":"http:\/\/jfdi-blog-csv-dates-changing-excel"},"modified":"2026-10-24T13:50:16","modified_gmt":"2026-10-24T13:50:16","slug":"csv-dates-changing-excel","status":"publish","type":"post","link":"https:\/\/jfdi.pro\/blog\/csv-dates-changing-excel\/","title":{"rendered":"Why dates change when you open a CSV, and how to stop it"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Dates change when you open a CSV because the file stores everything as plain text, and Excel guesses what each value is. Anything that looks a bit like a date becomes one: <code>1-2<\/code> turns into 2 January, the gene name <code>MARCH1<\/code> into 1 March, and <code>03\/04\/2025<\/code> into either 3 April or 4 March depending on your computer&#8217;s region settings. The fix is to stop Excel guessing, or to convert the file with something that reads the whole column before deciding.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/jfdi.pro\/convert\/\">Convert CSV to Excel, dates handled properly<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Three ways dates go wrong<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Text that isn&#8217;t a date becomes one<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Excel converts values such as <code>1-2<\/code>, <code>3\/4<\/code>, <code>JAN1<\/code> or <code>SEPT1<\/code> into dates. For part numbers, survey codes or scores, that&#8217;s corruption, and saving the file makes it permanent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The best-known case is genetics. A 2016 study in <em>Genome Biology<\/em> looked at the spreadsheets supplied with 3,587 papers in 18 journals and found gene names converted to dates in <strong>19.6%<\/strong> of them (<a href=\"https:\/\/revistapesquisa.fapesp.br\/en\/automatic-conversion-in-excel-changed-to-prevent-errors-in-genetic-studies\/\">Pesquisa FAPESP<\/a>). In 2020 the committee that names human genes gave up and renamed some: <code>SEPT1<\/code> became <code>SEPTIN1<\/code> and <code>MARCH1<\/code> became <code>MARCHF1<\/code>, so Excel would leave them alone.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Day and month swap<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>03\/04\/2025<\/code> means 3 April in the UK and March 4 in the US. Excel reads it using your computer&#8217;s region setting, so the same file gives different dates on different computers. Worse, it&#8217;s inconsistent within a file: on a UK-set computer, a US-format <code>03\/25\/2025<\/code> can&#8217;t be a valid day-first date, so it stays as text while <code>03\/04\/2025<\/code> beside it becomes 3 April. You end up with a column that&#8217;s half dates and half text, with the dates silently wrong.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Dates become numbers<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Excel stores dates as a count of days since 1900. When a date column ends up formatted as a number, or a date is copied to another program, you see values like <code>45748<\/code> instead of <code>1 April 2025<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fix 1: switch off the guessing in Excel<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In Excel for Microsoft 365 and Excel 2024 there&#8217;s a setting for exactly this. On Windows go to <strong>File \u203a Options \u203a Data<\/strong>; on a Mac go to <strong>Excel \u203a Preferences \u203a Edit<\/strong>. Under <strong>Automatic Data Conversion<\/strong>, untick <strong>Convert &#8220;date-like&#8221; combinations of continuous letters and numbers into a date<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Microsoft notes a limit: values with a space or punctuation, such as <code>JAN 1<\/code> or <code>JAN-1<\/code>, may still become dates (<a href=\"https:\/\/support.microsoft.com\/en-us\/excel\/set-automatic-data-conversions\">Microsoft<\/a>). For full control, use the next fix.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fix 2: import the file and set the column types<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open a blank workbook, choose <strong>Data \u203a From Text\/CSV<\/strong>, then <strong>Transform Data<\/strong>. Set code columns to <strong>Text<\/strong>. For real dates, right-click the column header and choose <strong>Change Type \u203a Using Locale<\/strong>, then pick the date format the file actually uses, such as <em>English (United States)<\/em> for month-first dates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fix 3: convert the file to Excel first<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/jfdi.pro\/convert\/\">JFDI file converter<\/a> looks at the whole column before deciding what a date means. If any value in it is like <code>25\/03\/2025<\/code>, which can only be day-first, it reads the whole column day-first. Only if a column is truly ambiguous does it fall back to your browser&#8217;s language, and you can set it yourself under <strong>Reading the file \u203a Dates like 03\/04\/2025 mean<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Real dates become real Excel dates you can sort and calculate with. Codes that only look like dates stay as text, and a column that mixes dates with other text keeps those values as text so nothing is lost.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When it writes CSV files, dates come out as <code>2025-03-31<\/code> (the ISO 8601 format), which every program reads the same way.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to write dates so this never happens<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you produce CSV files for other people:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Write dates as YYYY-MM-DD.<\/strong> <code>2025-04-03<\/code> can&#8217;t be misread, and it sorts correctly as text.<\/li>\n\n\n\n<li><strong>Keep codes unambiguous.<\/strong> A prefix or letters elsewhere (<code>PN-0102<\/code> rather than <code>1-2<\/code>) avoids accidental dates.<\/li>\n\n\n\n<li><strong>Say what each column is<\/strong> in a header or a readme, especially for IDs.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Related<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/jfdi.pro\/blog\/csv-leading-zeros-excel\/\">How to open a CSV in Excel without losing leading zeros<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/jfdi.pro\/help-convert.html\">The file converter guide: spreadsheets and data<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Excel turns 1-2 into 2 January, MARCH1 into a date, and swaps days and months depending on your computer&#8217;s settings. Scientists even renamed human genes because of it. Here&#8217;s why it happens and how to stop it.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[32,37,36,33],"class_list":["post-1016","post","type-post","status-publish","format-standard","hentry","category-file-conversion","tag-csv","tag-data-quality","tag-dates","tag-excel"],"_links":{"self":[{"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/posts\/1016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/comments?post=1016"}],"version-history":[{"count":2,"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/posts\/1016\/revisions"}],"predecessor-version":[{"id":1088,"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/posts\/1016\/revisions\/1088"}],"wp:attachment":[{"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/media?parent=1016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/categories?post=1016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jfdi.pro\/blog\/wp-json\/wp\/v2\/tags?post=1016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}