+ Reply to Thread
Results 1 to 3 of 3

5th-odr poly coefficients automatically displayed in excel cells?

  1. #1
    jason1
    Guest

    5th-odr poly coefficients automatically displayed in excel cells?

    Would like to create 5th- order polynomial trendline from data set and have
    coefficients automatically displayed in excel cells (one in each cell)

  2. #2
    sebastienm
    Guest

    RE: 5th-odr poly coefficients automatically displayed in excel cells?

    Hi,
    The following code adds a trendline (5th-order poly) to the first series on
    the active chart:
    '--------------------------------------------
    Sub test()
    Dim c As Chart, t As Trendline
    Set c = ActiveChart

    'check chart
    If c Is Nothing Then
    MsgBox "No chart selected"
    Exit Sub
    End If

    'add trendline to series 1
    Set t = c.SeriesCollection(1).Trendlines.Add(Type:=xlPolynomial, _
    Order:=5, Forward:=0, Backward:=0, DisplayEquation:=True, _
    DisplayRSquared:=False)

    End Sub
    '------------------------------------------
    --
    Regards,
    Sébastien
    <http://www.ondemandanalysis.com>


    "jason1" wrote:

    > Would like to create 5th- order polynomial trendline from data set and have
    > coefficients automatically displayed in excel cells (one in each cell)


  3. #3
    Mike Middleton
    Guest

    Re: 5th-odr poly coefficients automatically displayed in excel cells?

    jason1 -

    > Would like to create 5th- order polynomial trendline from data set and
    > have coefficients automatically displayed in excel cells (one in each
    > cell) <


    (1) Do you actually think there is some real-world data where the underlying
    process should be represented with a 5th-order polynomial? Be aware of
    possible overfitting the data in which case predictions are of dubious
    value.

    (2) But if you really want to do it, you could use the LINEST array-entered
    worksheet function.

    Tushar Mehta has some examples and tutorials at www.tushar-mehta.com.

    - Mike
    www.mikemiddleton.com



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1