Forum Discussion
Excel bug: Bad date handling in year 1900
Excel allows dates in at least three formats: Relative day (in general format), short date like DD/MM/YYYY, and long date with names of day and month. I can convert between them by changing the cell format. Relative day 1 gives 01/01/1900, a fair place to start counting. Relative day 60 gives 29/02/1900. Wasn't 1900 a normal year? Entering 29/2/2000 is allowed, entering 29/2/2100 is rejected, both responses expected. Day names are one day backwards for January or February 1900, OK after that.
All is well if you don't care where relative days start and don't go before March 1900, but if you want to match relative days with other dates converted outside Excel, they are always one day out!
Has anyone encountered this before? Nothing to do with the day difference function!
Adding to the link above, for the matching part of your question: outside Excel, count from 30 December 1899 as day zero, not 31 December. That gives the same number as Excel for every date from 1 March 1900 on, because the phantom 29/02/1900 (serial 60) pushes every later serial up by one. It is also the day zero Microsoft documents for OLE Automation dates (the .NET DateTime.ToOADate page), so many other tools already count that way.
Only 1 January to 28 February 1900 will still be one apart (and those day names are wrong in Excel, as the article says about WEEKDAY), so treat those two months as a special case if your data goes back that far. For example, 15 June 1950 is 18429 both ways, while 1 January 1900 is 1 in Excel and 2 when counted from 30 December 1899.
(Drafted with AI assistance; date math checked before posting.)
2 Replies
- VARSDigitalBrass Contributor
Adding to the link above, for the matching part of your question: outside Excel, count from 30 December 1899 as day zero, not 31 December. That gives the same number as Excel for every date from 1 March 1900 on, because the phantom 29/02/1900 (serial 60) pushes every later serial up by one. It is also the day zero Microsoft documents for OLE Automation dates (the .NET DateTime.ToOADate page), so many other tools already count that way.
Only 1 January to 28 February 1900 will still be one apart (and those day names are wrong in Excel, as the article says about WEEKDAY), so treat those two months as a special case if your data goes back that far. For example, 15 June 1950 is 18429 both ways, while 1 January 1900 is 1 in Excel and 2 when counted from 30 December 1899.
(Drafted with AI assistance; date math checked before posting.)
- dscheikeyBronze Contributor
Hello!
Yes, MS are aware of the problem. It won’t be resolved as doing so would cause more serious issues.
See also here: