[Edu-sig] MS EXCEL Error

Felix P. Muga II fmuga at ateneo.edu
Sat Dec 24 17:21:27 CET 2005


 IN MS EXCEL 1900 IS A LEAP YEAR

I was writing a Python program to find the exact date of Easter Sunday
for a given year after 1900 as an example for the course in Discrete
Mathematics which I am teaching to 2nd year undergraduate students in
my university.

A part of the program calls for computing the number of days from 1900
to the given year. Hence, I have to consider the number of leap years.
To derive the formula for finding the number of days, I used MS EXCEL
since it has an excellent resource about DATES. However, I found out
that MS EXCEL accepts the string '2/29/1900' as a legal date and even
considers '2/29/1900' as a WEDNESDAY. Also, MS EXCEL recognizes January
1, 1900 as a SUNDAY.

To verify these MS EXCEL results, I searched the WEB for the topic on
PERPETUAL CALENDAR which showed that JANUARY 1, 1900 is a MONDAY and
not a SUNDAY.

Furthermore, I found out that a LEAP YEAR is defined as a YEAR which
satisfies at least one of the two conditions:

1. The YEAR is a multiple of 4 and not a multiple of 100.
2. If the YEAR is a multiple of 100 then it must be a multiple of 400.

Hence, 1996 and 2004 are leap years since they satisfy the first
condition. Also, 1600 and 2000 are leap years since they satisfy the
second condition. However, 1900 is NOT a LEAP YEAR since it is a multiple
of 4 and a multiple of 100 but not a multiple of 400.

The error in MS EXCEL is only confined to the dates from January 1, 1900
to February 28, 1900 (an ASH Wednesday) and the illegal date of February
29, 1990.

Thus, a mistake occurs in the computation if these dates are involved.
An example is the problem of finding the number of days between January 1,
1900 and December 31, 2005. It assigns a serial number of 1 to January 1,
1900 and a serial number of 39,448 to January 1, 2008. However, the
correct serial number to January 1, 2008 should be 39,447. The error is
due to the existence of February 29, 1900 (serial number of 60) as a
valid date in MS EXCEL.

Fortunately, I discovered this problem and I was successful in writing a
Python program that returns the exact date of Easter Sunday for a given
year after 1900.

-- 
Felix P. Muga II, Ph.D.
Associate Professor
Mathematics Department
Ateneo de Manila University


More information about the Edu-sig mailing list