View Single Post
  #4  
Old 04-02-2011, 12:09 AM
mithrandir's Avatar
mithrandir (Andrew)
Registered User

mithrandir is offline
 
Join Date: Jan 2009
Location: Glenhaven
Posts: 4,161
I did this with OpenOffice, but I guess you can slum it with Excel. I generated some data with a linear and sinusodal component and a bit of randomness. The example is saved in Excel XP format.

Suppose you have 120 Xs in col A and 120 Ys in col B starting in row 3

In E3 put =SLOPE(B3:B122;A3:A122)
In E4 put =INTERCEPT(B3:B122;A3:A122)
In C3 put =A3*$E$3+$E$4
In D3 put =B3-C3

Select C3-D3 and drag the black square at the bottom right corner down to row 122. The formula copies.

Select A3-D122, the "Chart" tool, "X-Y scatter" "Points and Lines", ensure column A is the X values and columns B-D are the Y values.

Fiddle with the format to your heart's content.
Attached Files
File Type: zip example.zip (10.9 KB, 14 views)
Reply With Quote