+ Reply to Thread
Results 1 to 7 of 7

Bar chart, how to add value ONLY for visible bars

  1. #1
    Registered User
    Join Date
    05-18-2015
    Location
    Bratislava
    MS-Off Ver
    Office 2007
    Posts
    33

    Bar chart, how to add value ONLY for visible bars

    Hi guys.
    I am trying to do one smart things, but so far no success. Please, see below file, it's very simple..
    Some cells in this table are filled with some number, some aren't >> content of cell depends on some function. But in my example all is stated as FIX.But as in reality I use function (IF) there is ALWAYS something as a content...either value or NA().

    Now when I want to create bart chart, I want to add values to every bar, but ONLY for visible bars. You can see I used 100% overlapping, it's because to "delete" all empty bars where content of cell is NA(). Uou can see that I added values for "blue" bars but there are automatically many NA() values I would like to avoid.

    Please is thre any possibility (I don't want to solve this via macro) to force excel to show values only for those bars, where isn't cell content NA() ?

    thanks a lot.
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,616

    Re: Bar chart, how to add value ONLY for visible bars

    I'm not sure if you want NA() in data table or you introduced it there to prepare the data for plotting (could be wise in case of scatterplot for instance, but not for bars).

    If it is introduced there just for plotting, give it up and let the values be 0 or negative. then format labels text as custom format:
    0%,,, (in reality, you probably use the same separators as we do in Poland so: 0%;;

    If #N/A is real result - prepare extra column with copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and plot it, not column C itself
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    05-18-2015
    Location
    Bratislava
    MS-Off Ver
    Office 2007
    Posts
    33

    Re: Bar chart, how to add value ONLY for visible bars

    Hi Kaper.
    thank you for your reply. Yes, I use the same separators as you in Poland:-) I sit not too far from you, that's the reason

    Regarding our topic, unfortunately, either I didn't catch your point enitrely or something still needs to be enhanced. So far, I haven't tried scatterplot, but that's good idea, I will try it and see if it can solve my problem !

    But regarding bar chart, please, see below file. I replaced NA() values with 0 (zeros) and problem is still there. You see, that if I click add values to each of bar, there will be also those zeros I don't want to have there, I market them bold and red. And regardless if there are zeros, NA() or whatver, it will show up there.
    Of course, I can manually delete all those zeros from the graph directly, but problem won't be solved, as my graph will be DYNAMIC and thus bars will be different each time, based on user selection. So manual deletion of those zeros is not permanent solution.

    Another temporary "solution" which so far came to my mind is to entirely delete any content from those cells, where result of IF condition is zero or NA()...but again, this will be just temporary , as it all depends what user selects...sometimes there is zero, sometimes not.

    Overally I think what I want to do is not possible, only using macros maybe and so far I don't want to use macro for graph creation, it seems to muchwork around with VBA :-)
    Have a nice weekend.
    Attached Files Attached Files

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,616

    Re: Bar chart, how to add value ONLY for visible bars

    I'll try to check it later with Excel 2007, but with 2010 it works fine - it is formatting number for ethiquettes (labels)
    Attached Images Attached Images
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-18-2015
    Location
    Bratislava
    MS-Off Ver
    Office 2007
    Posts
    33

    Re: Bar chart, how to add value ONLY for visible bars

    Hi Kaper.

    thank you, i suppose I now understand your solution. It's very good, but when I set up the same label format for second and third bars (labels), it doesn't work. For first (blue in first graph and green in second) it's working. I suppose if it can be done for first (green) bar, then can be done also for other bars, but do you think it will work also when it's dynamic and sometimes one thus column has one "zero" and sometimes let's say five "zeros" ?
    Isn't label format " 0%;;; " working only for case when last 4 numbers (contents) are zeros as stated now ?

    thanks a lot for your time.

    I don't think it's MSO 2010 vs 2007 issue. But can't confirm, I have also MSO2010 but always graph will dissapear when I tried to apply the same number label format also for second and third bar....don't know why, maybe it's because I have just 2 month trial version. But in 2007 your format works, but not for second and third tab.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,616

    Re: Bar chart, how to add value ONLY for visible bars

    Number of zeros does not matter.
    Formatting string is divided into 4 sections separated by semicolon (in our local settings) first is for positive numbers, second negative , third zero, fourth text. so if you want to show negatibe numbers use custom formattiong similar to:
    0%;0%;;@
    or if you do not expect texts
    0%;0%;;
    or may be
    0%;-0%;;
    or
    0%;(0%);;
    etc
    having it like in first version
    0%;0%;;
    you have all labels displayed as positive numbers
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-18-2015
    Location
    Bratislava
    MS-Off Ver
    Office 2007
    Posts
    33

    Re: Bar chart, how to add value ONLY for visible bars

    Great, thank you very much Kaper. I didn't know these things.

    Have a nice day :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. coloring bars in a stacked bar chart (Yamazumi chart) on basis of text
    By Rob201 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2014, 04:56 AM
  2. How to align chart elements (dots) in chart to bars?
    By yessuz in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 01-22-2014, 07:46 AM
  3. change invisible bars back to visible
    By hf in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-28-2006, 09:35 AM
  4. Bars in a chart???????
    By Gee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1