X-Axis Dates Lose Formatting

Written by Allen Wyatt (last updated November 5, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


When Bruce copies a chart from one workbook to another, the dates on the X axis get transformed to five-digit numbers, typically starting with 4. This is a recent issue for Bruce, and he needs to know how to correct it.

There are a few ways you can approach this issue. First, the five-digit numbers (starting with 4) are date serial numbers. They are the numeric values maintained by Excel, internally, to represent dates. Each of those numbers represents the number of days since January 1, 1900. The fact that it is a five-digit number starting with 4 means that the dates are later than July 6, 2009.

The fact that you aren't seeing dates means that your axis values have lost their formatting. You can, if desired, right-click on the axis and choose to format it. Set the format to whatever date format you want, and you should be good to go.

I said "should be" because the problem could be a bit more involved than that. To illustrate, let's say that you create a workbook called Source.xlsx. In this, you have your data and you create an embedded chart based on that data. The chart has a series of dates along the X axis. (See Figure 1.)

Figure 1. Your data and the chart created from the data.

Now you create another workbook, this one called Target.xlsx. You copy the chart from Source.xlsx and paste it twice into Target.xlsx. (See Figure 2.)

Figure 2. Two copies of the chart pasted into the Target.xlsx workbook.

At this point, everything looks fine—the dates look just as expected on the X axis. Before doing anything else, though, select the X axis on the rightmost copy of the chart. Right-click the selected axis and choose Format Axis from the Context menu, and Excel displays the Format Axis task pane at the right side of the screen. (See Figure 3.)

Figure 3. Formatting the X axis.

At the very bottom of the options, you want to clear the Linked to Source check box and then close the task pane. Since this check box is selected, by default, when you paste the chart, you now have one copy of the chart (the left one) that has the option selected and one copy (the right one) that has it cleared.

Now close the Source.xlsx workbook but leave Target.xlsx open. Press F9 to recalculate the workbook, and all of a sudden you'll see that the left copy of the chart now shows the dates in their unformatted condition, just as Bruce was seeing. (See Figure 4.)

Figure 4. Unformatted dates in the left chart.

Interestingly, if you once again open the Source.xlsx workbook, then the dates will again be formatted correctly, automatically. That is because the formatting in the left chart is still linked to the chart in the Source.xlsx workbook.

So, the bottom line is that if you won't always have the source of the chart open while you are working with the target workbook, you'll want to change the format of the X axis (or any axis that contains dates) so that the Linked to Source check box is cleared.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10251) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

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

Offering Options in a Macro

When creating macros, you often need to offer a series of choices to a user. This tip demonstrates how easy it is to ...

Discover More

Editing a Comment Close to Its Cell

Have you ever chosen to edit a comment, only to find that the comment is quite a ways from the cell with which it is ...

Discover More

Protecting Your Revisions

Want to protect your documents so that people can't edit them without you knowing about it? One way is to make sure that ...

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)

Hyperlinks to Charts

You can create hyperlinks to all sorts of worksheets in a workbook, but you cannot create a hyperlink to a chart sheet. ...

Discover More

Positive and Negative Colors in a Chart

When creating a line cart, the line can show values both positive and negative values. This tip explains how you can use ...

Discover More

Adjusting the Angle of Axis Labels

When creating a chart, your axis labels may be wider than desired. One way to deal with them is to change the angle at ...

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}] (all 7 characters, in the sequence shown) 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 8 + 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


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.