Lines in chart when no data is present

R

RW

I have found the trick to prevent 0's from showing in a chart when the data
is blank:

If(H2="",NA(),H2/F2)

However, the chart line extrapolates from the previous data point to the
next datapoint instead of showing a gap. I've looked at Tools-Options-Chart
and the Active Chart - Plot Empty Cells as "Not Plotted (leave gaps)" is
selected.

The data is being charted on a secondary Y axis if this makes a difference.
Please help. I need to have gaps.
 
J

Jon Peltier

Because you don't have empty cells, you have formulas that return "", which
is a short piece of text. Unfortunately there is no function that simulates
a blank cell.

- Jon
 
S

ShaneDevenshire

By the way I also have a way to do it but its not pretty. There is also a
code solution which might be simplier but you would have to run it anytime
the data changes.
 
T

Tushar Mehta

Hi Jon,

I just retested versions of XL from 2000 to 2007: created a Line chart and
then tried to format a single point to 'no line'. As of today, in 2002
(SP2?) it still shows the line. I am reasonably sure that was the same
behavior with 2003 when it first came out but today the line disappeared for
the single point. So, it was probably fixed in some 2003 SP.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
J

Jon Peltier

This is vaguely familiar (everything before yesterday is only vaguely
familiar).

I just tested Excel 2003 SP2, and the line can be formatted as no line
without a problem. I recall that the issue was that instead of making the
line segment vanish, what Excel did was draw the line from the previous
point to the subsequent point, so the point in the middle was still there
but not connected to either adjacent point. I wonder if that was how Excel
2003 came out, and they fixed it (i.e., changed it back) in an SP.

- Jon
 
O

OssieMac

I'm not sure if I am on the right track with the problem but if I am, it
appears to me that you only have to select the chart, select Tools, Options,
Chart Tab and set the Plot Empty Cells option.
 
J

Jon Peltier

That only works with real blank cells, not cells in which a formula returns
"" or any other value.

- Jon
 
S

ShaneDevenshire

I should clarify, I test the idea of selecting the line segment that is
interpolated across the missing point and changed its color to None and it
worked in my copy of 2000 but not in 2002. These cells contained =NA(), not
a blank.

An alternate way to do this is to set the line color to match the background
color rather than to set it to None. With this approach there are issues,
but they can all be solved.
 
J

Jon Peltier

I know at some point this functionality was broken. However, it's fixed
again by Excel 2003 SP2; you can change a line segment to None, whether it
connects two regular points, spans a blank, or spans NA().

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top