Solved

Excel 2010 bar chart data labels

Posted on 2014-01-14
9
1,647 Views
Last Modified: 2014-01-16
I have a fairly simple bar chart that is linked to a table of data.  This data may be zero, a number greater than zero, or the cell may be blank because no data exists.  I want to show the data labels in the bar chart when the cell value is zero or greater, and I don't want the data label to appear if the cell is blank.

This seems straightforward, but after a lot of searching I have yet to come up with a solution as to how to make this happen.  If I could just suppress showing all zeros and blanks, it would be a piece of cake.  But I can't figure out how to show labels for zeros, while treating blanks as no label.  Using NA() won't work in blank cells because the chart will actually show that text as the label.  Any ideas?  I know there is a VBA solution here, but that seems rather inelegant, and this has to apply to quite a few charts.  Also, I'm don't want to hide rows or columns.  Thanks for your help!
0
Comment
Question by:Rich5150
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 39781481
Hi,

Could you send a sample ? Because I cannot see the problem

EDIT Do you have show Empty Cells as Zero or show Empty Cells as gaps?

Regards
0
 
LVL 6

Expert Comment

by:Mahesh Bhutkar
ID: 39781578
0
 

Author Comment

by:Rich5150
ID: 39782382
Here is an example file that shows what I'm referring to.  The issue is this:  I have a range of cells that is linked to the chart, and that range of cells is linked to some other raw data.  If the raw data cell is blank, I want the bar associated with it to just be a gap with no label.  If the raw data cell has a value of zero, then the graph will still show a gap, but will have a label of zero.  I can't figure out how to format the data labels to make that happen, and I'd like to avoid using VBA to do this due to the number of charts I'm working with.
Chart-Example.xlsx
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 39782528
Hi,

Select the data Labels from your Serie

and Change the format in Format Data Labels / Number eg.

to include the 0

#'##0.0;-#'##0.0;0.0;

Regards
Chart-Examplev1.xlsx
0
 

Author Comment

by:Rich5150
ID: 39785666
The problem is that is the raw data cell is blank, then the cell linked to it treats that as a zero, and adds the data label of zero to the graph.  I don't want that.  If the raw data cell is blank, then I just want a gap where the bar would be, with no label.  Your suggestion does not address this problem.
0
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39785759
I have a solution not very elegant but it works

in the B Column I've inserted a formula to add a notch to zero

Blank stays as zero and doesn't show

Regards
Chart-Examplev2.xlsx
0
 

Author Comment

by:Rich5150
ID: 39785792
Can you refresh my memory as to what this expression is doing?

C3+1E-20

I'm thinking it's scientific notation but just want to verify.
0
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 39786061
Hi,

C3+1E-20 is like saying C3+ 0,00000000000000000001   or 1*(10^-20)

Regards
0
 

Author Comment

by:Rich5150
ID: 39786072
That's what I thought.  I think that's as good a solution as any.  I've looked everywhere and I just don't think that Microsoft cares to change how charts recognize cells with zero values versus those that are blank when there are formulas involved such as in this case.  I appreciate your input!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question