Dates Copied Incorrectly

by Allen Wyatt
(last updated December 13, 2014)

9

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

Leaving a Cell Value Unchanged If a Condition Is False

Ever want the IF function to only return a value if the condition it is testing is true, and not if the condition is false? ...

Discover More

Deleting a Chart

Charts serve a purpose, and sometimes that purpose is temporary. If you want to get rid of a chart, here's how to do it.

Discover More

Adding Serial Commas in a Sentence

Part of the job of an editor is to apply standards of grammar to text written by someone else. One standard that may need to ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Can't Enter Years in a Cell

Sometimes getting the right thing to show up in a cell can be a bit tricky when working with dates. If you enter a year ...

Discover More

Pulling Apart Cells

Separating text values in one cell into a group of other cells is a common need when dealing with text. Excel provides a ...

Discover More

Changing Limited Relative References to Absolute

Do you need to change whether a particular reference in a formula uses a relative or absolute reference? If so, you may ...

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

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. Maximum image size is 6Mpixels. 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 2 + 1?

2017-04-06 11:16:30

Raju Mathew

I am trying to format as date correctly many option I use make it correct format but doesn't work can you help me pls.
here I am pasting the data
looking date format mm/dd/yyyy

19601016
19111111
19590407
19571124
19321029
19770816
19490930
19111111
19471031
19471013
19510530

Raju Mathew
email: raju.mathai@dallascounty.org


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.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

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.