Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Excluding Some Data from a Chart.

Excluding Some Data from a Chart

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


1

Pam keeps a month's worth of data in a table and created a chart based on that data. The data was collected from information generated on her company's shop floor. The data includes weekends, but Pam doesn't want the weekend data included in the chart. She knows that she could hide the rows and they would be excluded from the chart, but she still needs the hidden rows to be displayed in the table. In other words, she wants them displayed in the data table, but not in the chart.

There are a couple of ways you could approach this problem. One is to simply make a copy of your data (maybe copy the whole worksheet) and then delete the rows that contain weekend data. You would still have your master data for whatever purposes you need, but you could base your chart on the modified copy of that data.

The drawback to this, of course, is that it creates two sets of data that may need to be updated or kept in sync in some way. It may be better to base your chart on a non-contiguous data range. Assume, for a moment, that your data was in A1:B15, and that there were weekends in rows 7, 8, 14, and 15. You could, within the chart, set the data range for the source data to this:

=Sheet1!$A$1:$B$6,Sheet1!$A$9:$B$13

You could also create a named range that refers to the non-contiguous ranges you want included in the chart. You could then use the named range in your chart, as a reference to the source data.

Finally, if you don't mind adding another column to your data, you could use the new column for your chart source. Assume, for a moment, that your readings are in column A and the dates of those readings are in column B. In each cell of column C you could place the following formula:

=IF(WEEKDAY(B1,2)>5,NA(),A1)

You then end up with a series of readings for all weekdays; the weekends show #N/A for the reading. You can base your chart on this data and Excel will ignore the #N/A values. You can even hide column C so it does not distract from your source data.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7846) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Excluding Some Data from a Chart.

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

Copying Rows and Columns with the Mouse

Word allows you to do quite a few editing tasks using the mouse. If you want to copy rows or columns in a table, you can ...

Discover More

Rounding To the Nearest Even Integer

Do you need your numbers to be rounded to an even integer value? How you accomplish the task depends on the nature of the ...

Discover More

Removing a Bulleted or Numbered List

If you want to convert bulleted or numbered lists back to regular text (so they appear just like the rest of your ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Creating Charts in VBA

Most charts you create in Excel are based on information stored in a worksheet. You can also create charts based on ...

Discover More

Missing Bounds Options for a Chart

When your chart contains dates along one axis, you can set bounds on the way the chart is displayed. What causes, though, ...

Discover More

Specifying the Size of Chart Objects

Unhappy with the default size that Excel uses for embedded chart objects? You can't change the size at which they are ...

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 6 - 0?

2023-04-10 22:29:15

Tomek

Instead of copying the sheet, you could create the second sheet that just links to the original data. The easiest way to do this is to add a new sheet, then copy all original data, then on the new sheet Paste-Special-Paste Link. That way you will not have two sets of data to manage. The second sheet will automatically sync with the original data.

Using the extra column gives you most flexibility though, and allows for automatic identification of weekends in any month.


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.