+ Reply to Thread
Results 1 to 9 of 9

Chart with two sets of data on same axis

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    78

    Chart with two sets of data on same axis

    Hi,

    I've attached a file with data for Net Profit across four years.

    The Net profit is made up of two components across four regions.

    The Regions have the net profit achieved by a specific product across 2015, 2016, 2017 and 2018.

    The Regions then have the net profit achieved by the company across 2015, 2016, 2017 and 2018.

    For example, Product A achieved an 8.70% net profit in Region 3 for FY 2016. In that same year the net profit we achieved in Region 3 for the business was 4.60%.

    What I'm trying to do is show a comparative of the four regions for Product A in each financial year in a column chart.

    I then want to overlay the overall business net profit for these four regions as a line graph. I don't want four separate lines on the chart - I just want a single line with data points for each year.

    I'm actually beginning to wonder if this is possible as I've tried all I can think of and can't show the business net profit as a single line.

    If people can let me know if it is possible that would be great. If it is possible then some tips as to how to go about it would be fantastic.
    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,819

    Re: Chart with two sets of data on same axis

    A combination column + line chart should be readily doable. Your sample file does not include any of your attempts to create a chart, so we cannot see what you tried and what you might have done wrong.

    Here's what I did:
    0) Move "Product A Net Profit" from A3 to A2. This is not necessary, but Excel often wants to see the upper left cell of a chart's source data blank to better parse all of the data series definitions.
    1) Select A3:E9 -> Insert -> Line Chart
    1a) If Excel completely missed the desired series definitions, then I would pull up the Select Data Dialog and make sure all of the data series are defined correctly.
    At this point I have FYxxxx across the horizontal axis, percentages up the vertical axis, and 6 data series in the column chart (the one corresponding to row 8 is blank).
    2) I cannot see anything in the sheet labeled "overall business net profit", so I am not sure what row to use for the line chart series. Using the data series for region 1 in row 9 as a placeholder for whatever "overall business net profit" should be, I select this data series -> Design -> change chart type -> Line.
    3) I selected the row 8 blank data series and cleared this data series from the chart.
    At this point, I have a simple column + line combination chart showing the values in rows 4 to 7 as clustered columns showing how each region compares to each other for each fiscal year. I also have a line showing the values in row 9 (placeholder for the whatever the overall business net profit" values should be) overlaid over the columns.

    I find that many times charting questions are more about the spreadsheet than the chart. I have assumed that your real spreadsheet has the overall net business profit values calculated somewhere, but maybe that assumption is incorrect. If you have not calculated the overall business net profit somewhere, then perhaps the real solution is to calculate those values in a suitable row (maybe row 14??) so that your chart can refer to that row for the line chart portion of the combination chart.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    08-30-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Chart with two sets of data on same axis

    Hi MrShorty,

    Thanks for the reply.

    The difficulty for me is the line part of the chart.

    Rows 4 to 7 represent the product net profit in each region. Rows 9 to 12 represent the business (the aggregate) net profit for all products in each region.

    Therefore, 12.20% is the net profit for Product A in Region 1 during FY2015. 5.4% is the business net profit in Region 1 for the same period. I can get a line graph over the top of the columns but I have not been able to manage a single line to represent rows 9 to 12. I don't want four lines on the graph over the top of the clustered groups of 4 columns. I want to have four data points or markers showing what the net profit was in the business (rows 9 to 12)for the four regions in each financial year. The idea is to have this as a single line which travels across the whole graph from FY2015 to FY2018.

    As I say, I'm beginning to wonder if this is possible.

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

    Re: Chart with two sets of data on same axis

    I don't understand what you mean by both "I want to have four data points or markers showing what the net profit was in the business (rows 9 to 12)for the four regions in each financial year." and "this as a single line."

    I am usually pretty optimistic that most things you want can be done (with no promise that it will be easy). My attempt this time:

    1) Select A3:E14 -> Insert -> clustered column chart
    2) Delete the series for rows 8 and 13
    3) Select the data series for row 14, 12, 11, 10, 9 and change chart type to line.
    4) For the series that go with rows 9 to 12, format as marker without line.
    5) Enter values/formulas in row 14 that represent whatever you mean by "have a single line that travels across the graph". Maybe =AVERAGE(B9:B12)?

    Am I closer to understanding what you want that line to look like?

  5. #5
    Registered User
    Join Date
    08-30-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Chart with two sets of data on same axis

    I suspect it's probably not possible to accomplish what I'm trying to do.

    I have FYxxxx across the horizontal axis, percentage up the vertical axis and four data series in the column chart (Region 1 shown in row 4, Region 2 shown in row 5, Region 3 shown in row 6 and Region 4 shown in row 7).

    The data series for Region 1 shows 12.20% in FY2015. Next to this column I have a data series column for Region 2 showing 8.40%, a column for Region 3 showing 8.90% and a column for Region 4 showing 9.20%. These columns are clustered together above FY2015 on the horizontal axis. Over FY2016 I have Region 1 series showing 11.80%, a column for Region 2 showing 8.30%, a column for Region 3 showing 8.70% and a column for Region 4 showing 9.40% - again, all clustered together above FY2016 on the horizontal axis. The data series for Region 1 then shows 11.70% for FY2017, a column for Region 2 showing 7.50%, a column for Region 3 showing 9.10% and so on until I have four clusters of columns representing Region 1 through to Region 4 across the four financial years.

    That part is fairly simple.


    The second set of data for Regions 1 through to 4 which is found in rows 9 through to 12 give the net profit figures achieved by the business in those four regions across the four financial years.

    What I'm trying to do is show these percentages as a line on the graph.

    Therefore, the line would start at 5.40% (as measured by the vertical axis) in the first column which is Region 1 in FY2015. This line would then go to 4.70% in the second column for FY2015 which is Region 2. It would then go to 5.30% on the third column (Region 3) and then 4.90% in the fourth column for Region 4. The line would then continue on to the first column in the second cluster of columns at 5.70% as measured by the vertical axis. The line would travel on to 5.20% for the second column of this cluster above FY2016 on the horizontal axis, then to 4.60% in the third column and then to 5.20% in the column representing Region 4 for FY2016. This line would then continue across the graph to the first column above FY2017 to a point 6.00% which is the net profit the business achieved in Region 1 during FY2017. The line would continue to 5.10% in the second column over FY2017 which is the net profit achieved by the business in Region 2 during FY2017, continue on to a data point of 4.90% in the third column over FY2017 (net profit achieved in Region 3 for FY2017) and 5.30% in the fourth column above FY2017. The line would remain unbroken, traveling on across the chart to a data point of 6.80% in the first column of the fourth cluster of columns sitting above FY2018. It would then continue to 5.10% in the second column above FY2018, then to 5.10% in the third column and finishing at 5.70% in the fourth column representing the net profit achieved by the business in Region 4 during FY2018.

    Getting this information to display as a single line on the graph is what is causing me a great deal of trouble.

    Hope that makes it clearer as to what I'm trying to do and, if not possible, just let me know.


    Thanks.

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

    Re: Chart with two sets of data on same axis

    It should be possible, but I think you will need a clustered column + XY scatter to get this effect:

    1) I need all of the net business values (rows 9 to 12) into a single column for one data series. I select C9:C12 -> Copy -> Paste into B13:B16. Select D9:D12 -> Copy -> Paste into B17:B20. Select E9:E12 and copy into B21:B24.
    2) For an XY Scatter chart, I will need a column of "X" values so I clear the percent formats from G9:G24 and enter some values from 0 to 4 in G9:G24. For now, these are just placeholders, I will figure out what they need to be later.
    3) Select the chart -> Select data -> Add new data series -> values point to B9:B24.
    4) Select this new data series and change chart type to XY scatter (marker with line I assume).
    5) Bring the Select data dialog back up -> new data series -> Edit series -> Point X values for the XY scatter series to be G9:G24.
    6) Work through the values in G9:G24 so each data point ends up in the correct position.

    Assuming I understand what you want, that should be close to what you want.

  7. #7
    Registered User
    Join Date
    08-30-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Chart with two sets of data on same axis

    Hi mate,

    Could you attach the Excel file you're using. I'm not sure what the entry of data into cells G9:G24 is supposed to achieve. Why (and how) does this data get referenced?

    And maybe the graph you get from that data?
    Last edited by Wizards; 01-30-2019 at 12:59 AM.

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

    Re: Chart with two sets of data on same axis

    Here's the sample file.

    Because we are building a combination column + scatter (not line), we need a column of values for the scatter chart series to use for X values. This allows us to control the horizontal position of the data points. After changing the 5th data series to scatter, we use the Select Data dialog to reference the G9:G24 data as the X values data for the scatter chart.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-30-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Chart with two sets of data on same axis

    Quote Originally Posted by MrShorty View Post
    Here's the sample file.

    Because we are building a combination column + scatter (not line), we need a column of values for the scatter chart series to use for X values. This allows us to control the horizontal position of the data points. After changing the 5th data series to scatter, we use the Select Data dialog to reference the G9:G24 data as the X values data for the scatter chart.
    Wow! I've really learnt something. I'll have to work with it to understand it but that's fantastic.

    Thanks for your help - sensational.

+ 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: 5
    Last Post: 01-07-2017, 03:17 PM
  2. Replies: 10
    Last Post: 07-21-2014, 11:11 AM
  3. Two sets of data on one bar chart, can't get secondary axis
    By RaposoL in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-04-2013, 03:14 PM
  4. [SOLVED] Separate bars in dual axis bar chart with more than 2 data sets
    By harrijo in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-13-2013, 02:28 PM
  5. Two y axis data sets
    By davegugg in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-08-2009, 09:53 AM
  6. chart with different sets of % at X & Y axis
    By clng in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 03-13-2007, 03:46 AM
  7. [SOLVED] In Excel how do I label the axis of a chart with 2 sets of labels
    By Alan in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-13-2005, 11: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