Dates Copied Incorrectly

by Allen Wyatt
(last updated December 13, 2014)

8

John notes that when cutting and pasting dates between workbooks, they seem to change for no reason. For example, he did this with a workbook with 100 lines, 3 columns of dates, all with 2014 as the year. The pasted data all has 2010 as the year and the days are one digit earlier (17th becomes 16th, etc.).

The giveaway clue in John's description is that there is a four-year difference between what he copies and what is pasted. The problem is related to the two different "base dates" that Excel can use for calculating dates.

You see, internally Excel maintains dates as a serial number that represents the number of days from a given base date. This date is normally January 1, 1900, so a serial number of 1 is that date (January 1, 1900), 2 is the next day, 3 the following day, etc.

The 1900 base date is the default for Windows-based Excel versions. The other base date is January 1, 1904. Historically this is the base date used in Mac-based Excel versions. (I say "historically" because it isn't the default in the latest Mac versions. It is unclear exactly when Microsoft changed the default.) Microsoft used this second base-date system because early Macs had an inherent problem in dealing with dates before January 1, 1904—something related to how leap years were dealt with, if I recall correctly.

Under the 1904 base-date system, an internal serial number of 0 is January 1, 1904, 1 is the next day, and 2 is the day after. Note that with the two base-date systems the dates for any given serial number aren't off by only four years—they are off by four years and a day.

In John's situation, then, the source workbook has the base date set to the 1904 system. Within that workbook everything is fine, but when you copy the values (remember that you are copying numbers—serieal numbers—from one system to another) and paste them into a workbook that uses the 1900 system, the dates will appear to be off by four years and one day.

There are two possible solutions to the problem. First, you could change the base-date system used in the target worbook. You can do that by following these steps:

  1. Select the target workbook.
  2. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 and Excel 2013 display the File tab of the ribbon and then click Options.)
  3. At the left side of the dialog box click Advanced.
  4. Scroll down until you see the When Calculating this Workbook section. (See Figure 1.)
  5. Figure 1. The advanced options in the Excel Options dialog box.

  6. Make sure the Use 1904 Date System check box is selected.
  7. Click OK.

Now you should be able to copy the dates from the source to the target workbook without any of the problems originally noted. There is a drawback to this, however: Others will still have the same problem if they want to copy anything from the target workbook at a later date.

That brings us to the second possible solution: Adjust the dates after they are pasted into the target workbook. If you look at the underlying serial numbers that Excel uses on a system that uses the 1900 base-date system, you'll see that the serial number for 1/1/1900 is 1 and the serial number for 1/1/1904 is 1463. Thus, you could paste the dates into the target workbook, subtract 1462 from what you just pasted, and you would end up with properly adjusted dates for the target workbook.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10942) applies to Microsoft Excel 2007, 2010, and 2013.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Character Limits for Cells

Excel places limits on how much information you can enter into a cell and how much of that information it will display. This ...

Discover More

Visually Showing a Protection Status

Need to know if a worksheet or workbook is currently protected? Excel provides some tell-tale signs, but here are some ways ...

Discover More

Changing Outline Structure

When working with the outline of a document, you can easily move whole sections of your document. It is as easy as selecting ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

MORE EXCELTIPS (RIBBON)

Requiring Input

If you distribute a workbook that is used by others for data entry, you may want a way to make sure they fill in certain ...

Discover More

Pasting Excel Data within Word's Page Margins

The programs in the Microsoft Office suite are designed to work with each other easily. Sometimes there can be hiccups along ...

Discover More

Checking for an Entry in a Cell

You may be looking for a way to have a formula determine if a particular cell has anything in it. Here's how you can find the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven minus 6?

2014-12-22 02:12:51

Rudra Sharma

why not paste special as values and number formats?


2014-12-15 11:01:34

Roger Barnes

Willy is correct. A side effect of this bug is that for dates from Jan. 1, 1900 to Feb. 28, 1900 the WEEKDAY function returns an incorrect value, one day earlier in the week than what is correct. WEEKDAY(Jan. 1, 1900) returns 1 (Sunday). The correct value is 2 (Monday).


2014-12-15 09:48:22

Ciaran

ashim chakraborty (and DaveS)

Pasting as values may have the unwanted effect of preventing Excel from recognizing these values as dates.

The "Text to Columns" tool will re-import the dates in-place, using your system's date format.

Select the dates to convert. On the Data tab, click Text to Columns. In the next step, choose fixed width (but don't create any breaks). In the next step, under Column data format, click Date. Here you must describe the format of the date as it is (and not the format you want). So, using your example, you would choose MDY. The tool will convert the format, and you should see the dates formatted for your system, and right-aligned in the cell.


2014-12-15 04:52:15

DaveS

ashim chakraborty 13 Dec 2014, 09:46

If you are adding the date to a list in your file, one possible way would be to first use pastespecial to copy the format of the date cell in the originator's file into the target cell in your file:

[originator's file].Cells(1, 1).Copy
[your file].Cells(1, 10).PasteSpecial (xlPasteFormats)
Application.CutCopyMode = False

and then copy the cell's value.


2014-12-13 16:35:42

Neil Fitzjames

Thanks for the second tip.
I experienced the problem with transfers in csv from a Mac but discovered the 1904 fix after I had already modified much of the recipient file. so earlier corrected dates then became altered forward by 4 years which "mucked things up",

Method 2 in the Tip will be of great use.


2014-12-13 09:46:35

ashim chakraborty

I am having problem with managing dates of birth which I receive through email in excel sheets. In some cases the originator of excel file is having mm/dd/yyyy format but my system is having dd/mm/yyyy format. Kindly tell me how to convert mm/dd/yyyy format to dd/mm/yyyy format randomly.


2014-12-13 07:06:13

Anne615d

I've had this frustration many times in the past (I started with Mac and have some key "sample" documents I still recycle). Next time I'll try last week's tip to copy and paste +/- 1463 (paste special).


2014-12-13 06:56:43

Willy Vanhaelen

The 1900 base is inherited from Lotus 1-2-3 but has a bug: enter 60 in a cell and format it as date and you get 29 February 1900 but the year 1900 wasn't a leap year so the 29th is false and should be 1st March.

In general years who are a mutiple of 4 are leap years but years who are multiples of hundered like 1900 are not except for multiples of 400 like 2000 which was a leap year.


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing
Share