I would like to hide data labels on a chart that have 0% as a value. I can get it working when the value is a number and not a percentage. I could delete the 0% but the data is going to change on a daily basis.
I am doing a if statement to calculate which column to put the data into.Data is shown below
I have 2 bars one green and one red. When the value is above 8% the red bar shows and when the value is below 8%. At one time i can only show one bar. I would like to hide the 0% as the bar isnt being show.
3 Answers
The quick and easy way to accomplish this is to custom format your data label.
- Select a data label.
- Right click and select Format Data Labels
- Choose the Number category in the Format Data Labels dialog box.
- Select Custom in the Category box.
- In the format code box, enter
0%;-0%;and click Add. - Close out of your dialog box and your 0% labels should be gone.
This works because Excel looks to your custom format to see how to format Postive;Negative;0 values. By leaving a blank after the final ;, Excel formats any 0 value as a blank.
If using Office 2013 or later, type the format as mentioned above by Dav and Erik combined, i.e.
- Select a data label.
- Right click and select Format Data Labels
- Choose the Number category in the Format Data Labels dialog box.
- Select Custom in the Category box.
- In the format code box, enter 0%;-0%; "" and click Add.
- After this, select the newly added format in the Type box.
- Close out of your dialog box and your 0% labels should be gone.
You can also set the =NA() value in your empty Cells.