TL;DR - M$ Excel copied the bug from Lotus 123 for backwards fucked up compatibility.
Saved you the read, you’re welcome.
My question is, why did Lotus 1-2-3 have this bug?
Because, seriously, even the Gregorian formula is simple:
if year % 400 == 0; then leap = yes elif year % 100 == 0; then leap = no elif year % 4 == 0; then leap = yes else leap = noSure, you’re running three tests instead of one, but with nested if’s you could make so most years are only tested once, like this:
if year % 4 == 0; then if year % 100 == 0; then if year % 400 == 0; then leap = yes; else leap = no else leap = yes else leap = noSure, it’s dirty but if you got it right it’s set up and forget about it.
Probably in the time lotus was released people would use it for relatively simple calculations involving dates that would not go that far back. So this bug would not be a problem for those uses and go undetected for some time. Or maybe it even was a deliberate choice to improve performance since the creator would consider it unlikely to use dates decades away.
Much more likely : they just had a %4 and only added the %100 case when they tested dates with the year 2000. What about 1800? Can someone test this?
Also for any numeric less than 1 expressed as a date/time will display as January 0, 1900. Because January 1st is day 1. Kind of a shame because they really have an opportunity to support more dates in the past with negative values.



