Unwanted Weekend Dates in Chart

by Allen Wyatt
(last updated March 7, 2020)

Scott has a set of data by date that is used for a graph. The data is entered by date which only reflects weekdays. (The data contains no entries for weekends.) When Scott graphs the data using the dates as the horizontal axis, Excel inserts the weekend dates with no data points. These dates are not in the original data and he cannot seem to get rid of them so that only the data in the table is shown in the chart.

Believe it or not, this behavior is by design. When you convert your data into a chart, Excel tries to make sense of the data it is charting. If it determines that the data in a particular column or row represents dates, it looks at the earliest date in the range and the latest date in the range and then uses that as the range for the axis. That means that it includes data points in the range that may not really exist in the original data—such as the weekends that Scott mentions.

The solution to this is to overcome the automatic parsing done by Excel as it converts the data in your worksheet into a chart. There are a few ways you can do this. First of all, you can convert your original dates into text values. (Excel doesn't recognize text values as dates, and therefore doesn't do the whole earliest-to-latest range thing.) You could do this by actually converting the date column or row into text or by adding a helper column or row that contains the dates as text representations. If you decide to go the helper route, you could use a formula such as the following:

=TEXT(A1,"m/d/yy")

You could, of course, change the formatting pattern for the date to anything you want, as described in other ExcelTips. You would then use the helper column or row as your axis data in the chart. Excel recognizes it as text and includes only the datapoints in the worksheet—no more phantom weekends!

Interestingly enough, you can also fool Excel in its parsing by simply converting a single cell in the date column into a text value. It appears that if the entire row or column doesn't contain dates, Excel no longer applies the date-range parsing when putting together the chart.

If you don't want to modify your original data, you can simply tell Excel to ignore the date parsing. Follow these steps if you are using Excel 2007 or Excel 2010:

  1. Create your chart as you normally would. You should note that the chart includes the undesired phantom dates (weekends).
  2. Right-click the axis that contains the dates. Excel displays a Context menu.
  3. Choose Format Axis from the Context menu. Excel displays the Format Axis dialog box.
  4. At the left side of the dialog box, choose Axis Options. (See Figure 1.)
  5. Figure 1. The Axis Options of the Format Axis dialog box.

  6. In the Axis Type section of the options, choose Text Axis.
  7. Click OK to close the dialog box.

If you are using Excel 2013 or a later version, then the steps are a bit different:

  1. Create your chart as you normally would. You should note that the chart includes the undesired phantom dates (weekends).
  2. Right-click the axis that contains the dates. Excel displays a Context menu.
  3. Choose Format Axis from the Context menu. Excel displays the Format Axis task pane at the right of your work area.
  4. The Axis Options settings should automatically be displayed, but if not click Axis Options and then the Axis Options icon. (See Figure 2.)
  5. Figure 2. The Axis Options on the Format Axis task pane.

  6. In the Axis Type section of the options, choose Text Axis.
  7. Close the task pane, as desired.

At this point, Excel should redraw your chart and treat your dates as text values, even though they really are dates. This means that you won't get any phantom dates in the date range displayed in the chart. In addition, the dates on the axis should be displayed exactly as they appear in the worksheet data. Thus, if you want to change the way the dates are displayed in the chart, you'll need to reformat your source data for the desired appearance.

You should note that your ability to modify the Axis Type setting depends on the type of chart you are creating. If the chart doesn't have an axis (such as a pie chart) or the chart is primarily for plotting numbers (such as with an XY chart), then you may not be able to tell Excel to treat the axis as text. Why? Because doing so makes no sense in the case of those types of charts.

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

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

Automatically Formatting Text within Quotes

Some people use quote marks around text to make it stand out. At some point you may want to treat the quoted text ...

Discover More

ExcelTips: Times and Dates (Table of Contents)

Excel is great at storing all types of data, including times and dates. ExcelTips: Times and Dates provides the ...

Discover More

Deleting All Rows Except for the End of Month

If you use a worksheet to track day-to-day data, you might want to delete all of the data except the data for the last ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Colorizing Charts

Need to change the color of different parts of your chart? It's easy to do when you apply the technique described in this ...

Discover More

Creating Sparklines

Want a cool, small chart to show what your data is doing? You need a sparkline, discussed in this tip.

Discover More

Reading Values from Graphs

Adding a trendline to a graph will allow you to see trends a bit easier, depending on your data. You can even utilize an ...

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 + 9?

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.