Solved

Excel 2010 bar chart data labels

Posted on 2014-01-14
9
1,626 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
  • 4
  • 4
9 Comments
 
LVL 49

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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 49

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 49

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 49

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Countifs formula not counting data points 5 21
Dropbox in Windows Server 2008 4 30
Excel Question 17 15
Unhide very hidden sheets with password 22 44
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I comeā€¦
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

776 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