Hi All,
I know this is an old thread, but I wanted to contribute some code for getting r2 from LINEST using VBA. It's ugly, but it works.
Basically: Count through the two columns to be compared. If any row in either column is blank, skip it, otherwise copy the data for both columns to a temporary worksheet. Run LINEST on that temp worksheet and record the r2 value.
I then use conditional formatting to highlight r2 values above a certain threshold.
Also note: this would also be a good reply to this thread, but that one's locked: http://www.ozgrid.com/forum/showthread.php?t=41284
If forcing to zero, the r2 value reported here is correct (in Excel 2003 and later only) and that in the manually created chart is wrong. http://support.microsoft.com/kb/829249/en-us
Enjoy!
Alex
Bookmarks