Yellowbox wrote:
Hi SG,
=DATE(1900,1,1)+A2−2
Why the -2?
I was hoping I could just slip the adjustment of -2 in there without being asked to explain it!
The most convincing explanation is that the formula gives the wrong result without it!
I remember reading somewhere that Excel has always treated 1900 as a leap year, with 29 days in February of 1900. That seems only reasonable. After all, 1896 was a leap year and leap years come every fourth year, right?
Apparently NOT right! In the Gregorian calendar, a leap year is a year that is divisible by 4, UNLESS it is divisible by 100, in which case it is not a leap year unless it is also divisible by 400. So 1800 and 1900 were NOT leap years, while 2000 was a leap year.
Why -2 and not -1? I think that's because the formula starts with =DATE(1900,1,1) instead of =DATE(1899,12,31).
SG