B = Y Intercept
I used the two functions slope and Intercept but for some
reason the intercept is coming out wrong. Here is the
code...
Slope = Application.WorksheetFunction.Slope(Range
("e25:e28"), Range("c25:c28"))
Intercept = Application.WorksheetFunction.Intercept(Range
("e25:e28"), Range("c25:c28"))
The label on the graph shows y = 14484x + 562698 and so
my code should produce the same results but it doesn't...
My slope is 14483.664 (good)
My intercept is -28390146.1562596 (bad) should be 562698
Thoughts?: The 0nly thing I can think of is that the
values in the "c" range are 2000,2001,2002,2003 and
somehow my answer is the Y intercept at the year 0????
Or maybe the datatypes are causing a bad answer..one cell
range has the Excel 'Number' datatype and the other cell
range is the Excel 'Currency' datatype
Please advise
Alex.
|