Worried over Y2K? Now here's a Y1.9K problem

With all the talk about the year 2000 problem, you may not be aware that Excel also suffers from a year 1900 (Y1.9K) problem.

People who use Excel to store historical information often need to work with dates earlier than January 1, 1900. The only way to create a date such as July 4, 1776, in Excel is to enter it into a cell and have the program interpret it as text. Unfortunately, you can't manipulate dates stored as text - if you want to alter their formatting, for example, or if you need to calculate the day of the week they fell on.

To address this problem, I created an add-in (for Excel 97 or later versions) called Extended Date Functions. With this add-in installed, you'll have access to eight new worksheet functions that let you work with dates in any year from 0100 to 9999. You can download a free copy of it from www.j-walk.com, or from our cover CD of the October 1999 edition.

The new functions are:

XDATE(y,m,d,fmt): returns the specified date (as text) in the format specified by the fmt format string (optional).

XDATEADD(date1,day,fmt): returns the date (as text) that is day number of days after date1 in the format specified by the fmt format string (optional).

XDATEDAY(date1): returns the unique day number for a date.

XDATEDIF(date1,date2): returns the number of days between two dates.

XDATEDOW(date1): returns an integer corresponding to the day of the week.

XDATEMONTH(date1): returns the month number for a date.

XDATEYEAR(date1): returns the four-digit year for a date.

XDATEYEARDIF(date1,date2): returns the number of full years between two dates; useful for calculating ages.

Both XDATE and XDATEADD functions return a text string. You can't use Excel's date formats with this string, but you can provide a format string as an argument for the function. For example, the formula below adds five days to December 1, 1895 and displays the result as 'Dec-06-1895' (these functions use standard Excel format strings):

=XDATEADD("01/12/1895",5,"mmm-dd-yyyy")

Be careful if you plan to insert dates that occurred before 1752. Differences between the historical American, British, Gregorian, and Julian calendars can result in inaccurate computations. For details, check out http://www.cst.cmich.edu/users/GrahamS/Pub/Doomsday/DoomsdayIntro.html.

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

John Walkenbach

PC World
Show Comments

Brand Post

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Christopher Low

Brother RJ-4230B

This small mobile printer is exactly what I need for invoicing and other jobs such as sending fellow tradesman details or step-by-step instructions that I can easily print off from my phone or the Web.

Aysha Strobbe

Microsoft Office 365/HP Spectre x360

Microsoft Office continues to make a student’s life that little bit easier by offering reliable, easy to use, time-saving functionality, while continuing to develop new features that further enhance what is already a formidable collection of applications

Michael Hargreaves

Microsoft Office 365/Dell XPS 15 2-in-1

I’d recommend a Dell XPS 15 2-in-1 and the new Windows 10 to anyone who needs to get serious work done (before you kick back on your couch with your favourite Netflix show.)

Maryellen Rose George

Brother PT-P750W

It’s useful for office tasks as well as pragmatic labelling of equipment and storage – just don’t get too excited and label everything in sight!

Cathy Giles

Brother MFC-L8900CDW

The Brother MFC-L8900CDW is an absolute stand out. I struggle to fault it.

Luke Hill

MSI GT75 TITAN

I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?