Is there any way to access the trendline parameters in cell expressions?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,691
Office Version
  1. 365
Platform
  1. Windows
If I have a chart with a trendline, is there any way that I can use the trendline parameters in cell expressions?

The chart on the right plots the Conf column on the Y axis against the #Reviews column on the X axis. I found that a power series trendline matches almost perfectly. Now I want to use that equation to find the value for Conf based on other #Reviews values. To do that, I need the parameters of the power equation (coefficient = 1.2421 & exponent = -0.498).

I don't see any way to access those parameters in a cell equation. Is there any way?

1683742547171.png


Suppose I want
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I saw a recent video by My Online Training Hub recently that used the LINEST function to return the trendline co-efficients.
this is what I get when I use that with your data. I hope this gives some help:

I think the first value is the slope and the 2nd is the y intercept.

Book1
ABCD
1Rtg#ReviewsRankConf
25946710.0132
33910120.0130
44849930.0136
5574440.0445
6444450.0608
7342760.0625
858870.1328
945680.1673
1033990.2045
1149100.4081
1254110.6270
1332120.8727
14
15=LINEST(D2:D13,B2:B13)
16-3.30607E-050.297899387
JenniferMurphy
Cell Formulas
RangeFormula
A15A15=FORMULATEXT(A16)
A16:B16A16=LINEST(D2:D13,B2:B13)
Dynamic array formulas.
 
Upvote 0
There is also a LOGEST function for exponental charts . and maybe that will work with logarithms too.
 
Upvote 0
I saw a recent video by My Online Training Hub recently that used the LINEST function to return the trendline co-efficients.
The LINEST function fits a linear equation to the data. My data closely fits a power equation. A linear equation is not useful. I added a linear trendline to my chart. It shows the same parameters as you reported. I need the parameters for a power equation trendline.

1683749101327.png


PS: The linear trendline on the chart is not a straight line, because the X axis is logarithmic.
 
Upvote 0
The LINEST function fits a linear equation to the data. My data closely fits a power equation. A linear equation is not useful. I added a linear trendline to my chart. It shows the same parameters as you reported. I need the parameters for a power equation trendline.

View attachment 91393

PS: The linear trendline on the chart is not a straight line, because the X axis is logarithmic.
yes, i figured that. The LOGEST may work better for you.
 
Upvote 0
Maybe this will help. The link below shows how to calculate a power trendline in Excel (formula is near the bottom of the page).

Book1
ABCDEFG
1Rtg#ReviewsRankConf
25946710.01321.242679332
33910120.013-0.498242034
44849930.0136
5574440.0445
6444450.0608
7342760.0625
858870.1328
945680.1673
1033990.2045
1149100.4081
1254110.627
1332120.8727
Sheet2
Cell Formulas
RangeFormula
G2G2=EXP(INDEX(LINEST(LN(D2:D13),LN(B2:B13),,),1,2))
G3G3=INDEX(LINEST(LN(D2:D13),LN(B2:B13),,),1)
 
Upvote 0
Solution
Maybe this will help. The link below shows how to calculate a power trendline in Excel (formula is near the bottom of the page).

That works perfectly. Thanks.

I will never remember that expression, so I'd like to put in a UDF. Is there a way that I can use those expressions in VBA without putting application.worksheet in front of each function call?
 
Upvote 0
My knowledge of VBA is limited. Hopefully someone else can help you with a UDF.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top