+ Reply to Thread
Results 1 to 5 of 5

Displaying Trendline formula in Cell

  1. #1
    Registered User
    Join Date
    05-29-2008
    Posts
    14

    Displaying Trendline formula in Cell

    Hi,

    I have a graph with a trendline and I want to be able to display its formula on a cell so I can use it for calculations. Is there any way to do that? I am trying to do a polynomial regression.

    Thanks

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You can't display the formula per se, but the LINEST and LOGEST functions return an array containing all the parameters of the regression. If you want to see how, post some data and the plot with a trendline.

  3. #3
    Registered User
    Join Date
    11-26-2008
    Location
    Denmark
    Posts
    3
    For the given x-values and corrosponding y-values I wish to obtain coefficients for the best polynomium of 2nd degree, i.e. y=a0+a1*x+a2*x^2.

    How do I obtain the values a0, a1 and a2?

    x y
    1 1
    3 -2
    6 5
    8 3
    11 -4
    15 2
    20 -1

    I know I can get excel to show the equation for the trend line in a diagram, but I wish those values be put in a excel cell so I can use them for further calculations.

    Any help?

    - Kermit

  4. #4
    Registered User
    Join Date
    11-26-2008
    Location
    Denmark
    Posts
    3
    I forgot to post a sheet with the data points and the curve in my previous post.

    Sorry
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-26-2008
    Location
    Denmark
    Posts
    3
    I think I have solved the problem myself.

    I use the function linest(...)

    If I want the coefficients for a polynomium of degree 3 the syntax is
    linest([y-values];[x-values]^{1,2,3})

    For a 5th degree the syntax would be
    linest([y-values];[x-values]^{1,2,3,4,5})

    - Kermit

+ 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