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.
|