Is there a way to copy the trendline equation to an active cell outsite the
chart ?
Is there a way to copy the trendline equation to an active cell outsite the
chart ?
assuming it is a straighht line you can use the SLOPE and INTERCEPT function with the data taht was used to create the chart.
the eqation would look like this
=slope(B1:B20,A1:A20) * x + intercept(B1:B20,A1:A20)
where x is either a number or a cell reference to a number
Barrfly
Hi,Originally Posted by bushra
To view the specific formula for a trendline, on the chart, rightmouse the Data Series (to the window that lets you 'Add Trendline'), and one of the 'Trendline' options is 'View Formula on Chart', otherwise you can follow barrfly's post.
hth
---
Si fractum non sit, noli id reficere.
You can use the LINEST function to generate the same formula which is used to plot the trend line in a graph. LINEST an array formula, but I prefer to use the INDEX function to get data from it.
INDEX(LINEST (known Y's;known X's;;TRUE)1,2) returns the intercept value,
INDEX(LINEST (known Y's;known X's;;TRUE)1,1) retuns the multiplication factor
INDEX(LINEST (known Y's;known X's;;TRUE)3,1) retuns the R2 for the regression
If your function is non-linear you'll have to linearise and pass the linearised x and y value to the formula. The inverse linearisation on the result generates the desired values.
for example for a power function:
y = ax^b
ln(y) = ln(a) + b*ln(x)
passing ln(x) as [known x's] and ln(y) as [known y's]
will give ln(a) as intercept (thus exp(ln(a)) = a)
and b as multiplication factor.
Thanks Barrfly, your suggestion worked great.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks