[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

How to not display null values in Chart

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.
1 Solution
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))

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.
Danny ChildIT ManagerCommented:
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:
 - 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.
lizziesmalls23Author Commented:
Great explanation and thank you for the worksheet -- it fully solved my issue, appreciate that.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now