18

I have this data:

 X1      Y1      X2     Y2
  1      20       1     25
  2      20       3     42
  3      20       6     50
  5      25       8     50
 10      30      10     50

I want to create a graph that overlays two lines, one with X1 as X axis, Y1 as Y axis, and one with X2 and Y2.

Values with the same X are meant to line up, so at 3 on the X axis, there's supposed to be 20 for Y1 and 42 for Y2. Just adding two data ranges to the graph won't do that.

My current plan is to create two intermediate data ranges that are basically exploded, so it interpolates the data in each range so there's a value for every single X (see my question here). But that approach doesn't sound very smart, there must be a better way.

Note how 20 and 42 line up at 3 along the horizontal axis even though they are in different rows in the data range

16

Please try with layout as shown. Select A1:C11 (or to suit), insert Line chart with Use row 1 as headers and Use column A as labels:

WA63174 example

  • I guess I should feel embarrassed for not coming up with that myself. Thanks pnuts! – EboMike Jul 9 '14 at 5:56
  • I was having trouble getting this to work. Maybe I should feel embarrassed too. – Sridhar Sarnobat Oct 31 '16 at 22:56
  • 1
    Yeah i did get it to work eventually, though it does seem to ignore the 2nd series depending on your exact workflow. – Sridhar Sarnobat Oct 31 '16 at 23:58
0

There is no need to duplicate the X values.

  • Just put the Y2 values in a different column from Y1.
  • Create a chart from A1:C5.
  • Edit the chart and select line chart if necessary.
  • 3
    X values are not the same for Y1 data and Y2 data. Does your approach account for this? – user135384 Feb 10 '18 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.