Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trendline in charts
One way would be to use Linest or forecast or slope worksheet functions
against the source data. You can see how Bernard Liengme solves for the coefficients of a polynomial curve using LINEST. http://www.stfx.ca/people/bliengme/E...Polynomial.htm probably could be adapted to other type curves (an not adpation need for straight line). Chip Pearson posted some code to get the values from the chart itself: http://groups.google.com/groups?thre...GP09.p hx.gbl -- Regards, Tom Ogilvy "Dr.Schwartz" wrote in message ... When manually adding a trendline to a chart the equation and Rsquared can be displayed (DisplayEquation:=True, DisplayRSquared:=True). Is there any way to insert these values in two cells instead. Thanks The Doctor |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trendline in charts
Here is a worksheet formula to display the equation of the
line in one step (where XRange and YRange are the corresponding coefficient ranges): ="y = "&TEXT(SLOPE(YRange,XRange),"#.####")&"x "&TEXT (INTERCEPT(YRange,XRange),"+ #.####;- #.####") The R squared value is ="R squared = "&TEXT(RSQ(YRange,XRange),"#.####") -----Original Message----- One way would be to use Linest or forecast or slope worksheet functions against the source data. You can see how Bernard Liengme solves for the coefficients of a polynomial curve using LINEST. http://www.stfx.ca/people/bliengme/E.../Polynomial.ht m probably could be adapted to other type curves (an not adpation need for straight line). Chip Pearson posted some code to get the values from the chart itself: http://groups.google.com/groups?threadm=% 23hup3qhhEHA.1652%40TK2MSFTNGP09.phx.gbl -- Regards, Tom Ogilvy "Dr.Schwartz" wrote in message ... When manually adding a trendline to a chart the equation and Rsquared can be displayed (DisplayEquation:=True, DisplayRSquared:=True). Is there any way to insert these values in two cells instead. Thanks The Doctor . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trendline in charts
as has David Braden
http://groups.google.com/groups?selm....microsoft.com Jerry Tom Ogilvy wrote: .... Chip Pearson posted some code to get the values from the chart itself: http://groups.google.com/groups?thre...GP09.p hx.gbl |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trendline in charts
These functions only apply to simple linear regression. There are many
other trendlines that chart can fit, and the OP has not specified what kind of trendline. Jerry K Dales wrote: Here is a worksheet formula to display the equation of the line in one step (where XRange and YRange are the corresponding coefficient ranges): ="y = "&TEXT(SLOPE(YRange,XRange),"#.####")&"x "&TEXT (INTERCEPT(YRange,XRange),"+ #.####;- #.####") The R squared value is ="R squared = "&TEXT(RSQ(YRange,XRange),"#.####") -----Original Message----- One way would be to use Linest or forecast or slope worksheet functions against the source data. You can see how Bernard Liengme solves for the coefficients of a polynomial curve using LINEST. http://www.stfx.ca/people/bliengme/E.../Polynomial.ht m probably could be adapted to other type curves (an not adpation need for straight line). Chip Pearson posted some code to get the values from the chart itself: http://groups.google.com/groups?threadm=% 23hup3qhhEHA.1652%40TK2MSFTNGP09.phx.gbl -- Regards, Tom Ogilvy "Dr.Schwartz" wrote in message ... When manually adding a trendline to a chart the equation and Rsquared can be displayed (DisplayEquation:=True, DisplayRSquared:=True). Is there any way to insert these values in two cells instead. Thanks The Doctor . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trendline in charts
Understood; but if the linear formula is all that is
wanted certainly this is easier and faster. -----Original Message----- These functions only apply to simple linear regression. There are many other trendlines that chart can fit, and the OP has not specified what kind of trendline. Jerry K Dales wrote: Here is a worksheet formula to display the equation of the line in one step (where XRange and YRange are the corresponding coefficient ranges): ="y = "&TEXT(SLOPE(YRange,XRange),"#.####")&"x "&TEXT (INTERCEPT(YRange,XRange),"+ #.####;- #.####") The R squared value is ="R squared = "&TEXT(RSQ(YRange,XRange),"#.####") -----Original Message----- One way would be to use Linest or forecast or slope worksheet functions against the source data. You can see how Bernard Liengme solves for the coefficients of a polynomial curve using LINEST. http://www.stfx.ca/people/bliengme/ExcelTips/Polynomial. ht m probably could be adapted to other type curves (an not adpation need for straight line). Chip Pearson posted some code to get the values from the chart itself: http://groups.google.com/groups?threadm=% 23hup3qhhEHA.1652%40TK2MSFTNGP09.phx.gbl -- Regards, Tom Ogilvy "Dr.Schwartz" wrote in message news:F5236D26-F95C-4727-BE44- ... When manually adding a trendline to a chart the equation and Rsquared can be displayed (DisplayEquation:=True, DisplayRSquared:=True). Is there any way to insert these values in two cells instead. Thanks The Doctor . . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trendline in charts
True
Jerry K Dales wrote: Understood; but if the linear formula is all that is wanted certainly this is easier and faster. -----Original Message----- These functions only apply to simple linear regression. There are many other trendlines that chart can fit, and the OP has not specified what kind of trendline. Jerry K Dales wrote: Here is a worksheet formula to display the equation of the line in one step (where XRange and YRange are the corresponding coefficient ranges): ="y = "&TEXT(SLOPE(YRange,XRange),"#.####")&"x "&TEXT (INTERCEPT(YRange,XRange),"+ #.####;- #.####") The R squared value is ="R squared = "&TEXT(RSQ(YRange,XRange),"#.####") -----Original Message----- One way would be to use Linest or forecast or slope worksheet functions against the source data. You can see how Bernard Liengme solves for the coefficients of a polynomial curve using LINEST. http://www.stfx.ca/people/bliengme/ExcelTips/Polynomial. ht m probably could be adapted to other type curves (an not adpation need for straight line). Chip Pearson posted some code to get the values from the chart itself: http://groups.google.com/groups?threadm=% 23hup3qhhEHA.1652%40TK2MSFTNGP09.phx.gbl -- Regards, Tom Ogilvy "Dr.Schwartz" wrote in message news:F5236D26-F95C-4727-BE44- ... When manually adding a trendline to a chart the equation and Rsquared can be displayed (DisplayEquation:=True, DisplayRSquared:=True). Is there any way to insert these values in two cells instead. Thanks The Doctor . . |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trendline in charts
Thank you Mr. Dales. This was exactly what I was looking for!
"K Dales" wrote: Here is a worksheet formula to display the equation of the line in one step (where XRange and YRange are the corresponding coefficient ranges): ="y = "&TEXT(SLOPE(YRange,XRange),"#.####")&"x "&TEXT (INTERCEPT(YRange,XRange),"+ #.####;- #.####") The R squared value is ="R squared = "&TEXT(RSQ(YRange,XRange),"#.####") -----Original Message----- One way would be to use Linest or forecast or slope worksheet functions against the source data. You can see how Bernard Liengme solves for the coefficients of a polynomial curve using LINEST. http://www.stfx.ca/people/bliengme/E.../Polynomial.ht m probably could be adapted to other type curves (an not adpation need for straight line). Chip Pearson posted some code to get the values from the chart itself: http://groups.google.com/groups?threadm=% 23hup3qhhEHA.1652%40TK2MSFTNGP09.phx.gbl -- Regards, Tom Ogilvy "Dr.Schwartz" wrote in message ... When manually adding a trendline to a chart the equation and Rsquared can be displayed (DisplayEquation:=True, DisplayRSquared:=True). Is there any way to insert these values in two cells instead. Thanks The Doctor . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Charts - deciding what trendline to use! | Excel Discussion (Misc queries) | |||
Trendline Not Always Available | Charts and Charting in Excel | |||
Add value of a trendline | Charts and Charting in Excel | |||
How do I floodfill excel scatter charts only below the trendline? | Charts and Charting in Excel | |||
Trendline | Excel Discussion (Misc queries) |