Create multiple scatter graphs

rathalex

New Member
Joined
Oct 25, 2017
Messages
32
Hello!
I have data consisted of 18 columns. From these 18 columns I need to produce 9 graphs. However, i dont need to use entire columns for those,only last non empty cells. For instance, i need to take a value from last nonempty cell from a column A and B and use those two points to construct XY line plot. Then repeat that for C&D,E&F,G&H,I&J,etc. and add those lines to same chart. Could anyone help me with this task? Thank you!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
24203157
3521322536
462233
572334
2435
2536
this macro finds the last data pairs and puts them in columns J and K
ready for plotting
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 27/10/2017 by bob
'
'
For j = 1 To 10
If Cells(j, 1) = "" Then GoTo 50
temp1 = Cells(j, 1)
temp2 = Cells(j, 2)
Next j
50 Cells(1, 10) = temp1
Cells(1, 11) = temp2
For k = 1 To 10
If Cells(k, 3) = "" Then GoTo 60
temp1 = Cells(k, 3)
temp2 = Cells(k, 4)
Next k
60 Cells(2, 10) = temp1
Cells(2, 11) = temp2
End Sub

<colgroup><col width="64" span="15" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
2420311020445510112057
352132111955661021252536
462233121866771031301218
57233477881041357788
2435105140107150
2536106145
107150
this revised macro will deal with any number of columns
and a max nuber of rows can be set
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 27/10/2017 by bob
'
'
For a = 1 To 9 Step 2
Sum = Sum + 1
For j = 1 To 10
If Cells(j, a) = "" Then GoTo 50
temp1 = Cells(j, a)
temp2 = Cells(j, a + 1)
Next j
50 Cells(Sum, 15) = temp1
Cells(Sum, 16) = temp2
Next a
End Sub

<colgroup><col width="64" span="18" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
Thank you Oldbrewer! Actually I dont need to put these values anywhere. I just need to select values from last nonempty cells and plot lines for each set. In other words, i cant really pick numbers for row or column cause it might be over thousands...I need excel to grab values from last nonempty cells and plot them.
 
Upvote 0
I have "picked" each pair of values and placed them somewhere convenient. You can now use the first pair and plot them, copy the chart 4 times and edit the data values in those 4 charts. Now when you add new data, each chart will update automatically when you run the macro. Unless I am misunderstanding you....
 
Upvote 0
Not sure what you mean by that...I need Excel to create 9 graphs in one plot area. Why would I highlight and make chart if Excel could do it for me?
 
Upvote 0
you have to think what a scatter plot is - two points 1,1 and 3,3 joined by a line - easy. Now say you want to add another line between 2,2 and 5,5 - how are you going to do it.

I think I would make a second chart IDENTICAL in shape and size to the first one with 2,2 and 5,5 plotted, then move the second chart to be EXACTLY on top of the first chart....or make line charts each with only two data points...
 
Upvote 0

Forum statistics

Threads
1,215,580
Messages
6,125,654
Members
449,245
Latest member
PatrickL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top