Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Getting the values of the points in a trendline

Hi,

Based on a set of data, I've created a line pivot chart in Excel. I
have added a trendline, wich works perfectly! So, why this question?

Is it possible to get the specific values of a certain point on the
trendline? For example:


Pivot table:

[AverageUse]
Month Percentage
1 10,1234%
2 12,4678%
3 9,4373%

Now I've create a pivot chart (that's a bit difficult to reproduce with
ASCII-art;) and added a trendline, now I would like to see my pivot
table like this:

[AverageUse]
Month Percentage TrendlinePercentage
1 10,1234% 9%
2 12,4678% 13%
3 9,4373% 9%


Wich excel-guru has some briliant ideas?

Thanks in advance,

Best Regards,

Alain

  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel
external usenet poster
 
Posts: 1,163
Default Getting the values of the points in a trendline

Unfortunately (as far as I know) Excel does not give you easy access to the
trendline formula or its coefficients. You can, of course, calculate these
yourself but since we know Excel has calculated them already (after all, you
can choose to display the formula) it would be nice if the Trendline object
had a .Formula property that could be used.

But the best solution is to calculate them yourself from the chart's data
series. For info on the formulas there is a handy reference he
http://j-walk.com/ss/excel/tips/tip101.htm
--
- K Dales


" wrote:

Hi,

Based on a set of data, I've created a line pivot chart in Excel. I
have added a trendline, wich works perfectly! So, why this question?

Is it possible to get the specific values of a certain point on the
trendline? For example:


Pivot table:

[AverageUse]
Month Percentage
1 10,1234%
2 12,4678%
3 9,4373%

Now I've create a pivot chart (that's a bit difficult to reproduce with
ASCII-art;) and added a trendline, now I would like to see my pivot
table like this:

[AverageUse]
Month Percentage TrendlinePercentage
1 10,1234% 9%
2 12,4678% 13%
3 9,4373% 9%


Wich excel-guru has some briliant ideas?

Thanks in advance,

Best Regards,

Alain


  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.misc
external usenet poster
 
Posts: 5,600
Default Getting the values of the points in a trendline

Look into Linest or better still various post by David Braden on the
subject.

If you particularly want to replicate your own trendline's formula you could
try something like this - parses the formula of trendline(1) in series 1 to
a cell formula.

start by selecting a cell offset one to right of the first value you want to
calculate

Sub GetFormula1()
Dim sFormula As String
Dim ser As Series
Dim tLine As Trendline
Dim cht As Chart, sNum As String
Set cht = ActiveSheet.ChartObjects(1).Chart
Set ser = cht.SeriesCollection(1)
If ser.Trendlines.Count = 1 Then
Set tLine = ser.Trendlines(1)
tLine.DisplayEquation = True
If tLine.DisplayEquation Then
sNum = tLine.DataLabel.NumberFormat
tLine.DataLabel.NumberFormat = "0.00000000000000E+00"
sFormula = tLine.DataLabel.Text
tLine.DataLabel.NumberFormat = sNum
sFormula = Application.Substitute(sFormula, _
"y = ", "")
sFormula = Application.Substitute(sFormula, _
"x", "*" & ActiveCell.Offset(0, -1).Address(0, 0) & "^")
sFormula = Application.Substitute(sFormula, _
"^ ", " ")
ActiveCell.Formula = "=" & sFormula
End If
End If
End Sub

In xl2K+ can use Replace iso Application.Substitute

In a long discussion last year it became clear that the formula is useless
without a high degree of precision.

Regards,
Peter T


wrote in message
oups.com...
Hi,

Based on a set of data, I've created a line pivot chart in Excel. I
have added a trendline, wich works perfectly! So, why this question?

Is it possible to get the specific values of a certain point on the
trendline? For example:


Pivot table:

[AverageUse]
Month Percentage
1 10,1234%
2 12,4678%
3 9,4373%

Now I've create a pivot chart (that's a bit difficult to reproduce with
ASCII-art;) and added a trendline, now I would like to see my pivot
table like this:

[AverageUse]
Month Percentage TrendlinePercentage
1 10,1234% 9%
2 12,4678% 13%
3 9,4373% 9%


Wich excel-guru has some briliant ideas?

Thanks in advance,

Best Regards,

Alain



  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.misc
external usenet poster
 
Posts: 5,600
Default Getting the values of the points in a trendline

I forgot to also to say this parses a third order polynomial, would need to
adapt for other formulas.

Regards,
Peter T

"Peter T" <peter_t@discussions wrote in message
...
Look into Linest or better still various post by David Braden on the
subject.

If you particularly want to replicate your own trendline's formula you

could
try something like this - parses the formula of trendline(1) in series 1

to
a cell formula.

start by selecting a cell offset one to right of the first value you want

to
calculate

Sub GetFormula1()
Dim sFormula As String
Dim ser As Series
Dim tLine As Trendline
Dim cht As Chart, sNum As String
Set cht = ActiveSheet.ChartObjects(1).Chart
Set ser = cht.SeriesCollection(1)
If ser.Trendlines.Count = 1 Then
Set tLine = ser.Trendlines(1)
tLine.DisplayEquation = True
If tLine.DisplayEquation Then
sNum = tLine.DataLabel.NumberFormat
tLine.DataLabel.NumberFormat = "0.00000000000000E+00"
sFormula = tLine.DataLabel.Text
tLine.DataLabel.NumberFormat = sNum
sFormula = Application.Substitute(sFormula, _
"y = ", "")
sFormula = Application.Substitute(sFormula, _
"x", "*" & ActiveCell.Offset(0, -1).Address(0, 0) & "^")
sFormula = Application.Substitute(sFormula, _
"^ ", " ")
ActiveCell.Formula = "=" & sFormula
End If
End If
End Sub

In xl2K+ can use Replace iso Application.Substitute

In a long discussion last year it became clear that the formula is useless
without a high degree of precision.

Regards,
Peter T


wrote in message
oups.com...
Hi,

Based on a set of data, I've created a line pivot chart in Excel. I
have added a trendline, wich works perfectly! So, why this question?

Is it possible to get the specific values of a certain point on the
trendline? For example:


Pivot table:

[AverageUse]
Month Percentage
1 10,1234%
2 12,4678%
3 9,4373%

Now I've create a pivot chart (that's a bit difficult to reproduce with
ASCII-art;) and added a trendline, now I would like to see my pivot
table like this:

[AverageUse]
Month Percentage TrendlinePercentage
1 10,1234% 9%
2 12,4678% 13%
3 9,4373% 9%


Wich excel-guru has some briliant ideas?

Thanks in advance,

Best Regards,

Alain





  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.misc
external usenet poster
 
Posts: 5,600
Default Getting the values of the points in a trendline

I forgot to also to say this parses a third order polynomial, would need to
adapt for other formulas.

Regards,
Peter T

"Peter T" <peter_t@discussions wrote in message
...
Look into Linest or better still various post by David Braden on the
subject.

If you particularly want to replicate your own trendline's formula you

could
try something like this - parses the formula of trendline(1) in series 1

to
a cell formula.

start by selecting a cell offset one to right of the first value you want

to
calculate

Sub GetFormula1()
Dim sFormula As String
Dim ser As Series
Dim tLine As Trendline
Dim cht As Chart, sNum As String
Set cht = ActiveSheet.ChartObjects(1).Chart
Set ser = cht.SeriesCollection(1)
If ser.Trendlines.Count = 1 Then
Set tLine = ser.Trendlines(1)
tLine.DisplayEquation = True
If tLine.DisplayEquation Then
sNum = tLine.DataLabel.NumberFormat
tLine.DataLabel.NumberFormat = "0.00000000000000E+00"
sFormula = tLine.DataLabel.Text
tLine.DataLabel.NumberFormat = sNum
sFormula = Application.Substitute(sFormula, _
"y = ", "")
sFormula = Application.Substitute(sFormula, _
"x", "*" & ActiveCell.Offset(0, -1).Address(0, 0) & "^")
sFormula = Application.Substitute(sFormula, _
"^ ", " ")
ActiveCell.Formula = "=" & sFormula
End If
End If
End Sub

In xl2K+ can use Replace iso Application.Substitute

In a long discussion last year it became clear that the formula is useless
without a high degree of precision.

Regards,
Peter T


wrote in message
oups.com...
Hi,

Based on a set of data, I've created a line pivot chart in Excel. I
have added a trendline, wich works perfectly! So, why this question?

Is it possible to get the specific values of a certain point on the
trendline? For example:


Pivot table:

[AverageUse]
Month Percentage
1 10,1234%
2 12,4678%
3 9,4373%

Now I've create a pivot chart (that's a bit difficult to reproduce with
ASCII-art;) and added a trendline, now I would like to see my pivot
table like this:

[AverageUse]
Month Percentage TrendlinePercentage
1 10,1234% 9%
2 12,4678% 13%
3 9,4373% 9%


Wich excel-guru has some briliant ideas?

Thanks in advance,

Best Regards,

Alain







  #6   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.misc
external usenet poster
 
Posts: 5,600
Default Getting the values of the points in a trendline

I forgot to also to say this parses a third order polynomial, would need to
adapt for other formulas.

Regards,
Peter T

"Peter T" <peter_t@discussions wrote in message
...
Look into Linest or better still various post by David Braden on the
subject.

If you particularly want to replicate your own trendline's formula you

could
try something like this - parses the formula of trendline(1) in series 1

to
a cell formula.

start by selecting a cell offset one to right of the first value you want

to
calculate

Sub GetFormula1()
Dim sFormula As String
Dim ser As Series
Dim tLine As Trendline
Dim cht As Chart, sNum As String
Set cht = ActiveSheet.ChartObjects(1).Chart
Set ser = cht.SeriesCollection(1)
If ser.Trendlines.Count = 1 Then
Set tLine = ser.Trendlines(1)
tLine.DisplayEquation = True
If tLine.DisplayEquation Then
sNum = tLine.DataLabel.NumberFormat
tLine.DataLabel.NumberFormat = "0.00000000000000E+00"
sFormula = tLine.DataLabel.Text
tLine.DataLabel.NumberFormat = sNum
sFormula = Application.Substitute(sFormula, _
"y = ", "")
sFormula = Application.Substitute(sFormula, _
"x", "*" & ActiveCell.Offset(0, -1).Address(0, 0) & "^")
sFormula = Application.Substitute(sFormula, _
"^ ", " ")
ActiveCell.Formula = "=" & sFormula
End If
End If
End Sub

In xl2K+ can use Replace iso Application.Substitute

In a long discussion last year it became clear that the formula is useless
without a high degree of precision.

Regards,
Peter T


wrote in message
oups.com...
Hi,

Based on a set of data, I've created a line pivot chart in Excel. I
have added a trendline, wich works perfectly! So, why this question?

Is it possible to get the specific values of a certain point on the
trendline? For example:


Pivot table:

[AverageUse]
Month Percentage
1 10,1234%
2 12,4678%
3 9,4373%

Now I've create a pivot chart (that's a bit difficult to reproduce with
ASCII-art;) and added a trendline, now I would like to see my pivot
table like this:

[AverageUse]
Month Percentage TrendlinePercentage
1 10,1234% 9%
2 12,4678% 13%
3 9,4373% 9%


Wich excel-guru has some briliant ideas?

Thanks in advance,

Best Regards,

Alain






  #7   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel
external usenet poster
 
Posts: 837
Default Getting the values of the points in a trendline

Tushar Mehta has enhanced code by David Braden to extract coefficients
directly from a chart trendline
http://groups.google.com/group/micro...harting/msg/0e...
Note that for the chart trendline, you should format the equation to display
scientific notation with 14 decimal places.

Jerry

"K Dales" wrote:

Unfortunately (as far as I know) Excel does not give you easy access to the
trendline formula or its coefficients. You can, of course, calculate these
yourself but since we know Excel has calculated them already (after all, you
can choose to display the formula) it would be nice if the Trendline object
had a .Formula property that could be used.

But the best solution is to calculate them yourself from the chart's data
series. For info on the formulas there is a handy reference he
http://j-walk.com/ss/excel/tips/tip101.htm
--
- K Dales


" wrote:

Hi,

Based on a set of data, I've created a line pivot chart in Excel. I
have added a trendline, wich works perfectly! So, why this question?

Is it possible to get the specific values of a certain point on the
trendline? For example:


Pivot table:

[AverageUse]
Month Percentage
1 10,1234%
2 12,4678%
3 9,4373%

Now I've create a pivot chart (that's a bit difficult to reproduce with
ASCII-art;) and added a trendline, now I would like to see my pivot
table like this:

[AverageUse]
Month Percentage TrendlinePercentage
1 10,1234% 9%
2 12,4678% 13%
3 9,4373% 9%


Wich excel-guru has some briliant ideas?

Thanks in advance,

Best Regards,

Alain


  #8   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.excel.misc
external usenet poster
 
Posts: 5,600
Default Getting the values of the points in a trendline

Sorry about the triple post. OE, first time a TCP error, sent once again, 3
in total!

Peter T

"Peter T" <peter_t@discussions wrote in message
...
I forgot to also to say this parses a third order polynomial, would need

to
adapt for other formulas.



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
extrapolating points on a trendline Saied Excel Discussion (Misc queries) 2 April 21st 23 10:10 PM
Trendline when data points are missing Chris Moran Charts and Charting in Excel 2 May 12th 10 03:18 PM
Getting the values of the points in a trendline [email protected] Excel Discussion (Misc queries) 7 May 11th 06 08:55 AM
Trendline points Blondie Excel Programming 1 March 31st 06 09:15 PM
Trendline excluding last 2 data points of series Mary Ann Charts and Charting in Excel 2 June 15th 05 01:17 PM


All times are GMT +1. The time now is 05:00 PM.

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

About Us

"It's about Microsoft Excel"