Hide 0 values in excel chart

Gabriell

New Member
Joined
Jan 9, 2017
Messages
26
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hi Experts!

I want to create a chart in Excel and hide the values that are zero.

The percentage is calculated using a formula. If I replace zero values with =NA(), the percentage cannot be calculated, and the chart becomes empty.

Is there any solution to fix this?

Thank you in advance!
Gabor
 

Attachments

  • chart_1.JPG
    chart_1.JPG
    63.3 KB · Views: 18
  • chart_2.JPG
    chart_2.JPG
    97.7 KB · Views: 16
Hi,
What if you just put a 0 for the error values in the sum. Like so:
Excel Formula:
=B21/SUM(IFERROR(B21:B38, 0))
 
Upvote 0
Nothing will change...
 

Attachments

  • chart_3.JPG
    chart_3.JPG
    71.7 KB · Views: 11
Upvote 0
Do not put the IFERROR before the whole, only in the SUM. You want to keep the error in column B.

Two methods :
- Either you filter your table without the #N/A.
- Or you use a dynamic range based on the FILTER function, again to remove #N/A as a base. You need to make 2 named ranges pointing to this two FILTER columns to use them as a graph source.
 
Upvote 0
Do not put the IFERROR before the whole, only in the SUM. You want to keep the error in column B.

Two methods :
- Either you filter your table without the #N/A.
- Or you use a dynamic range based on the FILTER function, again to remove #N/A as a base. You need to make 2 named ranges pointing to this two FILTER columns to use them as a graph source.
If I use filter, it works, but I'd like to avoid the extra work.
Can you give me please, more details about the 2nd option?
 
Upvote 0
Okay so the procedure is as follows:

You need two empty columns, in one you write the formula (replace Table1 with the name of your table) :

(1) =FILTER(Table1[Segment], NOT(ISERROR(Table1[QTY 2025])))

And in the other one

(2) =FILTER(Table1[%], NOT(ISERROR(Table1[QTY 2025])))

Then you go to the name manager, and you give the first cell of each of this columns a name. For instance if formula (1) is in F2, you define its name like so (put the name you want). BE VERY CAREFUL TO MANUALLY ADD THE "#" AT THE END of "refers to".
1743756869187.png

Do the same for the other formula.
You have two named ranges : let's say graph_leg for formula (1) and graph_perct for formula (2).

Now in your graph, go to the Select Data Source => Edit Legend Entries, and write the name you defined for formula (1). You need to put in front of it, either the name of the workbook, or the name of the worksheet. Like below for Sheet/Workbook named "Book2".
1743756917703.png

Do the same for Horizontal Axis Labels with formula (2).

Now your graph is dynamic \o/.
 
Upvote 0
Hi Peter, the result is the same as my 1st post. I think the op wants to disable the legend for #NA values. (so in your case the graph legend should only contain A,C,E,H). Hence the filter & named ranges.
 
Upvote 0
Hi Peter, the result is the same as my 1st post. I think the op wants to disable the legend for #NA values. (so in your case the graph legend should only contain A,C,E,H). Hence the filter & named ranges.
Sure, just a different formula to produce the table results. I was hoping that actually showing the data, formula results and chart image would show it working.
The OP's image in post #3 has red arrows pointing at the 0% sections of the chart, not at the legend, so I presumed those red arrows were showing that they wanted the chart sections removed.
 
Upvote 0
Something like this,
Excel Formula:
=IF(ISNUMBER(B21), B21/SUMIFS($B$21:$B$38, $B$21:$B$38, ">0"), NA())
1743800262267-png.124113
 

Attachments

  • 1743800262267.png
    1743800262267.png
    99.4 KB · Views: 18
Upvote 0

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