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

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.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Laura Johnston

MSI GS65 Stealth Thin

If you can afford the price tag, it is well worth the money. It out performs any other laptop I have tried for gaming, and the transportable design and incredible display also make it ideal for work.

Andrew Teoh

Brother MFC-L9570CDW Multifunction Printer

Touch screen visibility and operation was great and easy to navigate. Each menu and sub-menu was in an understandable order and category

Louise Coady

Brother MFC-L9570CDW Multifunction Printer

The printer was convenient, produced clear and vibrant images and was very easy to use

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?