Preventing Null values from plotting in Excel Charts.

Hello EE,

I am working on creating a report on data that is constantly changing.  I want to plot the only cells with records.  In the attached spreadsheet, if i click on column B7 to show Group 1, there are 21 records that needs to be plotted.  If i click on B7 to select Group 2 there are 6 records to be plotted.  For group 2, I want to delete or hide cells that are not populated and only plot the cells that are populated with data.  I am thinking this can be accomplished using vba.  My goal is to create 2 separate reports for Group 1 and Group 2

Thanks in advance for your assistance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
For all the data series, replace the "" in the formulas with NA() like below...

e.g. the formula in C13 should be like below......

=IFERROR(INDEX('My Sample Data'!D$6:D$32,SMALL(IF('My Sample Data'!$C$6:$C$32=$B$7,ROW('My Sample Data'!D$6:D$32)-ROW('My Sample Data'!$B$6)+1,""),ROW(C1))),NA())

Open in new window

Change all the formulas in the same way for column D,E,F,J,K,L and M.
fb1990Author Commented:
Thanks Subodh,

This does not work for me.  It is showing #N/A.  I do not want it to show.  Is there a way to hide the empty cells and only plot where there are records?
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Actually it is the easiest workaround this issue.
Don't worry about the #N/A errors which you see in the cells, you can hide them with the conditional formatting by making a new rule for conditional formatting using the formula below and set the font color exactly same as that of the fill color.
First select the range A13:C33 and use the formula given below for conditional formatting.

Open in new window

Please refer to the attached.
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

fb1990Author Commented:
thanks again for staying with me on this.  Although the data for blank cells are not showing on chart, the space is still on the chart.  Is there a way to make the chart grow with the chart instead of showing it as blank space on the chart?
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Okay. I have created 7 named ranges and used them as a source in the charts.
You may customize the charts as per your requirement.

Please refer to the attached.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fb1990Author Commented:
Thank you very much Subodh.  I really appreciate your help
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome. Glad to help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.