How many times have you created a chart in Excel and seen something like this?
That dip on the graph is because somewhere in your worksheet you have a blank cell. As well as being annoying to you as the chart creator, it is also misleading to anyone who tries to interpret what your chart is trying to tell them!
The obvious solution might have been to delete rows, or to put some values in the blank cells to pad out the data.
However this will end up being even worse... Either omit important information, or visualize incorrect data that wasn't there to begin with.
How can we create a chart that is accurate but takes into account those rogue cells?
Here are the instructions:
About the author of this article
Yoav Ezer co-authors the technology and productivity blog Codswallop. He is also the CEO of a company that produces PDF to Excel conversion software.
For more Excel tips from Yoav, join him on Facebook or Twitter
That dip on the graph is because somewhere in your worksheet you have a blank cell. As well as being annoying to you as the chart creator, it is also misleading to anyone who tries to interpret what your chart is trying to tell them!
The obvious solution might have been to delete rows, or to put some values in the blank cells to pad out the data.
However this will end up being even worse... Either omit important information, or visualize incorrect data that wasn't there to begin with.
How can we create a chart that is accurate but takes into account those rogue cells?
Creating a Non-Continuous Line Graph
What we need is a chart like this one below...Here are the instructions:
- Make sure the graph type is Line and not Stacked Line
- Select the chart
- In the chart menu click on: Design -> Select Data
- In the dialog that comes up, click the 'hidden and empty cells' button
- Then select 'gaps', and click OK.
About the author of this article
Yoav Ezer co-authors the technology and productivity blog Codswallop. He is also the CEO of a company that produces PDF to Excel conversion software.
For more Excel tips from Yoav, join him on Facebook or Twitter
BONUS VBA MACRO: Excel 2003 Style menu in Excel 2007 / 2010
Are you going for an interview ?
3 things to remember before Excel VBA Interview
50 Excel VBA Interview questions
or looking for a job ?
Excel, Access, SQL, VBA, MIS, Reporting and Data Analysts Jobs
3 things to remember before Excel VBA Interview
50 Excel VBA Interview questions
or looking for a job ?
Excel, Access, SQL, VBA, MIS, Reporting and Data Analysts Jobs
Comments
The problem is usually that the user has a formula that returns "". It looks blank to us mortals, but Excel knows that "" is text (albeit a short piece of text), and Excel automatically assigns text a value of zero. No blank cell setting anywhere (gap, interpolate, whatever) will change the treatment of a non-blank cell.
The best you can do is change "" in your formula to #N/A or NA(), either of which place the #N/A error into the cell. This error is not plotted as a point in an XY or Line chart, and if the series has lines, the lines interpolate across the #N/A.
PS: It's my and my blog's pleasure to receive comments from an expert like you. I'm a big fan of you and Walkenbach :)
Regards,
Anand Kumar
Thanks... thank you very much...
you are simply awesome
Change "" in your formula to #N/A or use NA(), hence the error won't plot in the chart. (Referenced from Jon)
Regards
Ashish Jain