Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Charts - deciding what trendline to use! debbied Excel Discussion (Misc queries) 1 November 3rd 09 04:36 AM
Trendline Not Always Available Douglas Eckert Charts and Charting in Excel 3 September 11th 06 08:25 PM
Add value of a trendline Peter Doherty Charts and Charting in Excel 1 May 31st 06 12:39 AM
How do I floodfill excel scatter charts only below the trendline? RWB7s Charts and Charting in Excel 2 March 12th 06 04:31 PM
Trendline Carter Excel Discussion (Misc queries) 0 January 20th 06 12:45 PM


All times are GMT +1. The time now is 06:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"