Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. 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

by Allen Wyatt
(last updated May 31, 2017)

4

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 and 2010. 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

Editing a Toolbar Button Image

You already know that Word allows you to customize the tools on your toolbars. You may not have known that it also allows you ...

Discover More

Formatting Line Numbers

Legal documents often use automatic line numbering for their documents. If you want to format those line numbers, you can do ...

Discover More

Finding the Last-Used Cell in a Macro

Ever wonder what the macro-oriented equivalent of pressing Ctrl+End is? Here's the code and some caveats on using it.

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)

Changing Chart Type

Charts can either be embedded in a worksheet or take up an entire sheet by themselves. Changing from one type of chart to the ...

Discover More

Changing Elements in Lots of Charts at One Time

Got a bunch of charts that you need to make formatting changes in? You can use a macro (or two) to apply the formatting ...

Discover More

Setting Grid Line Intervals for a Radar Chart

Excel provides a wide varity of chart types you can use with your data. Unfortunately, this variety can often make it ...

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 8Mpixels. 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 - 4?

2017-05-31 12:12:30

Mike

Joe

The "2" indicates that the week starts on a Monday.

Here is a link to additional information on the Weekday function - http://bettersolutions.com/excel/functions/weekday-function.htm


2016-06-27 15:27:05

Joe

I've tried this formula and get #VALUE! as the result.

In A1-A17, I have my data (number of widgets produced) and in B1-B17, I have the day of the week.

In the formula,

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

what does the 2 reference? I can follow everything else in the formula.


2016-01-06 10:32:41

Justin McGuirk

Hello. In Cell (A1) I have Week, (B2) Tuenover, (C1) Customer (Main) (D1) Customer

A3, A55 I have week 1,2,3,4 etc up to week 52. B3,B55 I have turnover from week 1 to week 52. C3,C55 I have our mains customers turnover, D3,D55 I have customer turnover week 1 to 52. F3 to F55 is the following formula =(b3$b$b57)*100 which gives each entity as a % of the entire business. My question is I am unable to plot Turnover, Customer Main and Customer as a % of overall business are you able to help please


2014-01-02 11:19:56

Glenn Case

Note you can also suppress plotting of certain values by hiding them. So if you don't want weekend data shown, you could add a filter to screen out Saturdays and Sundays. The data would still be there, but not included in the charts.


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.