+ Reply to Thread
Results 1 to 11 of 11

Line graph with two lines that start at different x values

  1. #1
    Registered User
    Join Date
    10-12-2009
    Location
    Santa Cruz, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Post Line graph with two lines that start at different x values

    Hi everyone,
    I am trying to create a line chart in Excel with two lines, each of which starts and ends at a different x axis value, but which overlap slightly. I know how to create the two lines, but when I try to select the x-axis values, Excel defaults the second line's first point at the value at which the first line starts. I have tried selecting both the whole range of x-axis values as well as each individual range, to no avail. What I want is for, say, the x-axis to range from -44 to 60, and the first line should start at -44 and end at 10, and the second should start at 0 and end at 60. Thus, both lines would be on the same axis, and would start and end at different points, but would overlap slightly.

    I am using Excel 2008 for Mac, but I would imagine that this function in the 2007 for Windows version would work similarly.

    A prompt response would be especially appreciated, given that I am doing this for a paper that is due tomorrow (I am a student).

    Thanks in advance for any help that anyone can offer.

    Laura
    Last edited by lmorett; 10-14-2009 at 04:41 AM. Reason: solved

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Line graph with two lines that start at different x values

    Hi,

    can you post a sample of your data? without that, it's really hard to help, because it very much depends on how your data is layed out in your spreadsheet.

    cheers

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Line graph with two lines that start at different x values

    Here is an example of what I made up based on your post. Does that help any?

  4. #4
    Registered User
    Join Date
    10-12-2009
    Location
    Santa Cruz, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Line graph with two lines that start at different x values

    Hi Teylyn,
    Thanks for your help. You guessed correctly; my data is pretty similar to the data that you've posted. The only differences that I can see are the following: 1.) The scale changes slightly in incrementation 2.) There is one value on the x-axis for the 2nd line (Russian) that doesn't have a value, since that value wasn't tested in that language. I'm attaching a copy of my data for your reference.

    What I really need is a step-by-step walk through that will allow me to get the type of graph that you've created (if that's possible given my data), since your hypothetical graph reflects the format that I'd like to see.

    Laura
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-12-2009
    Location
    Santa Cruz, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Line graph with two lines that start at different x values

    Sorry for my ambiguity regarding the missing data point; what I meant to say is that there is one value on the x-axis that doesn't have a point on the 2nd (Russian) line.

    Let me know if you have any questions.

    Laura

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Line graph with two lines that start at different x values

    Hi Laura,

    you need to select the data source for each series from row 2 to row 17. Currently your English series starts in row 11, which Excel will attribute as the first category (or X axis point).

    So, define your data source and for English select B2:B17 and for Russian select C2:C17

    See attached for an example. hope you can use it on your Mac. I also used the (Windows) setting Tools - Options - Chart tab - Interpolate to connect the single data point in the russian series to connect with the rest of the line.

    does that help?

  7. #7
    Registered User
    Join Date
    10-12-2009
    Location
    Santa Cruz, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Line graph with two lines that start at different x values

    Hi Teylyn,
    Thanks for sending me the example graph (which displays as I would like it to on my version of Excel) and explaining to me how to select the data to create the type of graph that I want. However, I tried to replicate what you had done myself, but on my version of the graph (which I am attaching), the English line starts at -44 instead of at 0. I double-checked the values for the data ranges for both lines to ensure that they run from rows B2-B17 and C2:C17, and that the x-axis values in both cases also run from A2:A17. Do you have any idea what might be causing Excel to start the English line at -44, despite that the values in the spreadsheet for the English dataset don't start until 0? (Perhaps I should try selecting the Russian data first, although I don't see why this would make a difference.)

    Here is a step-by-step description of what I did to create my version of the graph:
    1.) Select English dataset (B2:B17).
    2.) Select line graph from Chart ribbon.
    3.) Go to Chart>Source Data... and select data for x-axis (A2:A17)
    4.) Go to Chart>Add Data... and select Russian dataset.
    5.) Select data for x-axis (A2:A17).

    The menu layout in Excel 2008 for Mac is a bit different from the one in 2007 for Windows, so I am still trying to find the interpolate function (I'll keep working on that...it's got to be here somewhere). Also, I should mention that Excel v. 2008 for Mac is buggy, so if we can't come up with a solution for why Excel is starting the English line at -44 instead of at 0, it may very well be due to a glitch in the program itself.

    Let me know if you have any further questions.

    Laura
    Attached Files Attached Files

  8. #8
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Line graph with two lines that start at different x values

    Sorry, I could not open the latest attached file.

    but here are the steps that should work.
    -Select B1 to C17
    -click the ribbon to insert a line graph

    This should get your lines layed out like in my previous attachment, and the rest is just fine tuning.

  9. #9
    Registered User
    Join Date
    10-12-2009
    Location
    Santa Cruz, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Line graph with two lines that start at different x values

    Hi Teylyn,
    After some messing around within the Source Data dialog box, I was able to figure out how to solve the problem and make my version of the graph look like yours. At first, I tried selecting both datasets off the bat when creating the graph, as you suggested, but Excel divided it up oddly, so I had to respecify the values in the Source Data dialog. This time, I selected the Russian dataset first, and then added the English dataset. It seems that this may have made the difference, as I guessed.

    Although I wasn't able to locate the menu option for interpolate, I found out that I can use the formula =na() in the empty cell, and it will perform the same function within the graph.

    Thanks for all of your help!

    Laura

  10. #10
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Line graph with two lines that start at different x values

    Great. Glad it's working for you now.

    In Excel 2007 you can set the interpolate thus: in the Select Data Source dialog, click the "Hidden and empty cells" button, and then set the Option "Show empty cells as" to "connect data points with lines". Maybe there are similar options in XL Mac 2008

    Please mark your thread as solved when all is OK now.

  11. #11
    Registered User
    Join Date
    10-12-2009
    Location
    Santa Cruz, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Line graph with two lines that start at different x values

    Hi Teylyn,
    I checked the Source Data dialog, but there is no such option in v. 2008. As I said, I'm sure it's here somewhere; it's just a matter of finding it. But for my purposes, the function worked.

    I tried to mark the thread as solved yesterday, but I didn't see how to do it right away. I just looked under the How to...? thread and found the explanation of how to do it, so I did it.

    Thanks for your help!

    Laura

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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