Reputation: 441
I have some data in excel that I want to graph in a pie chart (see image 1) where the text will be the labels and the numbers will turn into percentages. The problem is, when i go to graph the data, it shows the labels for ALL of the sections, even the ones that are 0% in the pie chart. So this really overtakes my entire chart. I do not want to manually select the data as this is a dynamic spreadsheet and sections that are zero now may not be zero down the line.
Is there a way to tell excel to not at all display the labels for the sections that are 0%??
as you can see in the current graph (second image), there are way more labels than there are sections in the pie chart, and it looks extremely busy.
Thank you!
Upvotes: 0
Views: 3250
Reputation: 6418
You don't show your data, so I will assume it is in column B
, with category names in column A
Generate a new column with the following formula:
=IF(B2=0,"",A2)
Then right click on the labels and choose "Format Data Labels"
Check "Value From Cells", choosing the column with the formula and percentage of the Label Options.
Under Label Options -> Number -> Category
, choose "Custom"
Under Format Code
, enter the following:
0%;;
Result should look like this:
(labels selected so you can see there's a blank one)
Upvotes: 0