How Excel stores dates
Excel stores a date-time as a number of days. The integer part is the date and the fraction is the time of day, so 45000.75 is 18:00 on 15 March 2023. In the default 1900 system, serial 1 is 1 January 1900. Older Mac workbooks use the 1904 system, where serial 0 is 1 January 1904, a difference of 1,462 days. If dates from a colleague's file are four years off, the file uses the other system.
Excel inherited a bug from Lotus 1-2-3 that treats 1900 as a leap year. Serial 60 is displayed as 29 February 1900, a day that never existed, and serials 1 to 59 are off by one compared with serials from 61 on. This converter applies the correct base on each side of the bug and gives a warning when you enter serial 60.
Examples to try
Serial numbers have no time zone
A spreadsheet cell holds wall-clock time without a zone. To turn it into an epoch, the converter needs to know which zone the spreadsheet meant, so the zone selector is part of the input. The reverse also applies: the Excel rows in the outputs list are labelled with the zone they are rendered in. To convert in Excel itself, use =(A1-25569)*86400 for Unix seconds, which assumes the cell holds UTC.
Questions
- What is serial 25569 in Excel?
- 25569 is 1970-01-01, the Unix epoch, in the 1900 system. Unix seconds = (serial - 25569) × 86400 when the serial is UTC.
- Does Google Sheets have the 1900 bug?
- No. Google Sheets counts from 1899-12-30 for all dates. It matches Excel from 1 March 1900 onward and differs only for January and February 1900.
- Why can't I convert a negative serial?
- Neither Excel date system supports dates before its start, so negative serials are reported as unsupported instead of being extrapolated.