Not show zero values in chart

Duncgee

Board Regular
Joined
Oct 7, 2002
Messages
73
I want Excel not to show zero values in data labels on a pie chart.

I also want the corresponding name not to show on the Legend.

Advice please, anyone?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
add a filter to the source data, customn filter out values that = zero - excel's default is to plot visable cells only.

Paddy
 
Upvote 0
PaddyD thanks for your help. I am most greatfull.

That almost works perfect, but when I add a filter as you suggest, the row stays hidden even when the data changes and cell no longer has a zero value. Can the filter be made to reflect changes in the data.

Since my original post I have come up with a macro to hide the columns in which there was a zero value. It also unhides the columns when the value is not zero.(I had the data in a row, for the filter they had to be in a column)



Sub HideColIfZero()
'Hides column(s) with zero so chart does not show zero or it's coresponding label entry.

For Each C In Worksheets("Sheet1").Range("S2:Z2")
If C.Value = 0 Then
C.Activate
Selection.EntireColumn.Hidden = True

End If

Next C

For Each C In Worksheets("Sheet1").Range("S2:Z2")
If C.Value <> 0 Then
C.Activate
Selection.EntireColumn.Hidden = False

End If

Next C

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

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