Jun 05 2024 03:41 AM
Hi,
I'm trying to create a graph with labels that will appear only when there are non-zero values in the cells. When I tick label contains Value and I add in the cusotm number format #"" the label dissappears when the cell value is zero. If I tick Label contains "Series Name" then the label always appears. Is there a way, custom format etc. to have the same behavious as when I'm using the cell value in the label?
Thank you all,
Tassos.
PS: O365 on Win 11 Pro
Jun 06 2024 02:48 PM
Unfortunately, there is not a direct way to achieve this using Excel's standard chart labeling features without some form of workaround. To achieve dynamic data labels in Excel that show the series name only when the value is non-zero, you can use a combination of data labels and a helper column. This method works around the limitation of using custom number formats directly with series names.
Here is how you can do it:
1. Create a Helper Column:
2. Set Up Your Data:
For example, if your data starts from row 2:
C2: =IF(B2=0, "", A2)
3. Create Your Chart:
4. Add Data Labels:
5. Set Data Labels to Use Helper Column:
This way, the data labels will display the series name when the value is non-zero and will be blank when the value is zero.
Step-by-Step Example:
Assume your data is structured like this:
Series | Values |
A | 0 |
B | 10 |
C | 0 |
D | 20 |
1. Helper Column:
Series | Values | Helper |
A | 0 | |
B | 10 | B |
C | 0 | |
D | 20 | D |
2 . Create Chart:
3. Add Data Labels:
4. Format Data Labels:
This method ensures that the series names only appear when the corresponding value is non-zero, effectively mimicking the behavior you want.
Note:
The text and steps were edited with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and Like it!
This will help all forum participants.