Hide category names from pie chart if value is zero

Nuz

Board Regular
Joined
Aug 16, 2010
Messages
88
I have a pie chart in Excel 2010 where I need to show category name, percentage and leader lines in the chart. The data typically have some zero values in it that I do not want to show on the pie chart.

I can hide the zero percentages by using custom number format 0,0 %;-0,0 %;"" but it still leaves the category name and the leader lines visible which makes the chart confusing and messy to read.

Here hiding rows/columns where the data is located is prohibited and macros cannot be used. Is there any way to accomplish this?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Thanks. It worked.
Easiest way was to create a dummy-data where zeros are replaced with NA() and make the chart to refer to that dummy data rather than the original data.
 
Upvote 0
Glad it did,
Be cautious though......
just to make sure your working data is linked to your chart data in case if someone updates the original data the graph displays the data accordingly.
 
Upvote 0
Super helpful! Thank you so much!! :)


one solution is to replace the zero result with n/a result if you do this the data is simply ignored and will not be displayed. The syntax for n/a is na(), for example:

If( your calculation=0,na(),your calculation)

hope it helps.
 
Upvote 0
This is saying:
If (whatever my original calculation was) is returning ZERO
Then (instead of putting ZERO) return "N/A" [the error message]
Else (do whatever my original calculation was).

This is essentially intercepting the data and returning the ability to have the graph "freak out in a good way" by not including a ZERO value and instead just not displaying the offensive value.

Sorry for my delay in responding, elizabethlee... believe it or not, I forget my username! [and yes, I'm getting more sleep and taking my vitamins now....!] ;)
Hi, may I know If( your calculation=0,na(),your calculation) what is this mean?
 
Upvote 0

Forum statistics

Threads
1,223,530
Messages
6,172,851
Members
452,484
Latest member
vmexwindy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top