+ Reply to Thread
Results 1 to 7 of 7

Adding percentage as a second y-axis on chart?

  1. #1
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Adding percentage as a second y-axis on chart?

    Hi all,

    I bet this is embarassingly simple, but having done quite a bit of Googling and experimenting on my own, I haven't yet been able to figure it out.

    I'm attaching an Excel file.

    Basically I have 7 time based intervals with a count for each interval. I have also calculated the percentage for each count based on the total.

    I've set this up as a bar chart showing the count at each interval.

    What I'd like is to have the percentage included as well. I envisioned a secondary axis with percentage, but if there's some other way that's also a possibility.

    Thanks in advance for any help.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,844

    Re: Adding percentage as a second y-axis on chart?

    I don't know that it is embarrasingly simple (in some ways, it is suprisingly difficult). I would not be surprised if there are other charting applications that would do this easily, but, in Excel, it is not obvious how to do this.

    I'm sure there are several approaches. I would probably do something like this proportional secondary axis technique: https://peltiertech.com/secondary-ax...tional-scales/ The tutorial is written for a line chart/scatter chart, but it should be fairly straitforward to combine the scatter chart for the "dummy" secondary axis with your column chart. Are you familiar with combining XY scatter charts and column charts? Can you piece this together, or do you need further help?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Adding percentage as a second y-axis on chart?

    Hi, Mr Shorty,

    I appreciate your efforts and I did try to implement that article, but no luck. They seemed to suggest that I needed to download some additional software also.

    If it's actually not easy to do this, I think perhaps I'll rather let it slide since it's not THAT important. It would just be a nice extra visual, I think.

    It is however odd if this isn't easy to do in Excel as I imagine it is a feature many others than me would like to have.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,844

    Re: Adding percentage as a second y-axis on chart?

    you don't absolutely need the XY chart labeler add-in. If you have access to 2013 or later, then this feature is built into Excel. You could also write your own VBA procedure that will add the desired data labels as text in cells. Rob Bovey's add-in is free and does this job very well for those of us late adopters who have not upgraded, yet.

    I'm curious what you tried, and why it did not work. I would have expected something like:

    1) Compute values for secondary axis in spreadsheet
    1a) Enter a row of six cells, all containing the value 7.5 (0.5+number of categories in chart).
    1b) Desired fractions/percentages for axis labels (I would expect 0, 0.1, 0.2, 0.3, ...) in six cells below 1a
    1c) A formula to compute the absolute value associated with each axis label. Your percentages appear to be calculated as =C11/SUM($C$11:$I$11). This should be the same formula, rearranged to find C11. Assuming 1b was entered in C16:H16, this might be =SUM($C$11:$I$11)*C16
    2) Add "dummy axis" to chart
    2a) Select data -> add series -> values is C17:H17
    2b) Select newly added data series -> Change chart type -> XY scatter markers and lines
    2c) My version automatically added the secondary Y and X axes. If yours does not, add these axes.
    2d) Format secondary X axis so the max is 7.5, which should move the "dummy axis" to the far right.
    2e) Format secondary Y axis so that its min and max limits match the primary Y axis.
    2f) Add data labels (using the chart labeler add-in, your own VBA procedure, or using the built in option in 2013 or later) to the dummy axis.
    2g) Hide the secondary Y and X axes.

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Adding percentage as a second y-axis on chart?

    Hi

    How did you want the percentage data displayed? Just as data labels, or as an actual plot on the chart? You could simply add the percentages as another series, plot it on a secondary axis and then set the series to no fill and add data labels. See attached example.
    Attached Files Attached Files
    Last edited by xlnitwit; 01-23-2018 at 05:21 AM.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  6. #6
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Adding percentage as a second y-axis on chart?

    Quote Originally Posted by MrShorty View Post
    I'm curious what you tried, and why it did not work. I would have expected something like.
    Hi, MrShorty,

    I tried various things without luck, but quickly dismissed it since it isn't that important and considering that I have a lot of charts to create. If it takes a long time for each chart, it might not be worth it right now.

    But, I sincerely appreciate your efforts.

  7. #7
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Adding percentage as a second y-axis on chart?

    Quote Originally Posted by xlnitwit View Post
    Hi

    How did you want the percentage data displayed? Just as data labels, or as an actual plot on the chart? You could simply add the percentages as another series, plot it on a secondary axis and then set the series to no fill and add data labels. See attached example.
    Hi,

    Absolutely great! Seeing what you did, I might want to do it the other way around (count on top of each bar and percentage as main axis).

    Trying to recreate what you did and fumbling around a bit, I actually managed to pull it off with the secondary axis. So, I guess, problem solved.

    Thank you all.
    Attached Files Attached Files

+ 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. Replies: 2
    Last Post: 09-04-2017, 11:05 AM
  2. Adding Horizontal Axis Labels to Chart without Selecting the chart
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2017, 11:32 AM
  3. [SOLVED] Adding Horizontal Axis Labels to Chart without Selecting the chart
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2017, 04:02 PM
  4. Pivot chart stacked, axis in values labels in percentage
    By rpinxt in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-01-2016, 03:42 PM
  5. Replies: 1
    Last Post: 11-20-2015, 12:50 PM
  6. Conditional Formatting Percentage Axis for Thermometer Chart
    By 09cwoppe in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-12-2014, 07:40 AM
  7. [SOLVED] Adding Number & Percentage to Chart
    By bigman8424 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-22-2013, 10:49 AM

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