Solved

How to not display null values in Chart

Posted on 2013-12-24
3
273 Views
Last Modified: 2013-12-26
I want my chart to not display values if there isn't any data (or a zero, or na()) within the cell.

Excel sheet and screen shot attached for further explanation.
ExpExchange-Question.png
ExpExchange-Question.xlsx
0
Comment
Question by:lizziesmalls23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39738598
I suggest that you use either Tables or dynamic named ranges as the source of your data. Either one will grow (or shrink) with the amount of data.

On one tab, I created two named ranges: Dates and Values using these Refers to formulas:
='Using dynamic named ranges'!$B$3:INDEX('Using dynamic named ranges'!$B$3:$B$100,COUNT('Using dynamic named ranges'!$B$3:$B$100))
=OFFSET(Dates,0,1)

I then clicked on one of the columns and then changed the resulting series formula for your chart to:
=SERIES('Using dynamic named ranges'!$C$2,'ExpExchange-QuestionQ28325281.xlsx'!Dates,'ExpExchange-QuestionQ28325281.xlsx'!Values,1)
Note the use of the workbook name to qualify the named ranges (instead of the worksheet).

On the other tab, I used a Table. Charts built from a Table will automatically grow and shrink as you add data.
ExpExchange-QuestionQ28325281.xlsx
0
 
LVL 23

Expert Comment

by:Danny Child
ID: 39738787
This kind of thing comes up more often with line charts - often used to display trends over time, but they can commonly have a datapoint missing in the sequence.

If this is the case, r-clicking the chart.. choose Select Data... and then click the Hidden And Empty Cells button.  Then, choose Connect Data Points With Line.
note, this only works on Line charts, not Stacked Line.
you also may need to ensure that zero values are actually entered as =NA()
If you don't want to enter these values, use a helper cell with this formula:
=IF(C4>0,C4,NA())
 - and then plot the chart on the results of the helper formula.

This works better with giving a smooth trend line for the chart, but won't deal with the issue as fixed by Byundt's suggestion where you're removing the empty white space from the right hand side of the chart.
0
 

Author Closing Comment

by:lizziesmalls23
ID: 39740200
Great explanation and thank you for the worksheet -- it fully solved my issue, appreciate that.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question