+ Reply to Thread
Results 1 to 4 of 4

Trend Line - Equation

  1. #1
    Rich 80105
    Guest

    Trend Line - Equation

    I have a chart with a trendline, with the equation for the trendline
    displayed in the chart.

    How can I either format the equation or reference thecomponents of the
    trendline elsewhere in the spreadsheet.

    The display says y = 27.894x - 1E+06
    and I would like to be able to at least display the second number
    differently, and preferably be able to reference thetwo numbers
    separately elsewhere in the spreadsheet.

    Can this be done (I am using Excel 2000)

    Thank you
    Rich 80205

  2. #2
    MartinW
    Guest

    Re: Trend Line - Equation

    Hi Rich,

    Your equation is in the form y = mx + c where
    m = the gradient
    c = Y- Intercept

    Use the function SLOPE to return the gradient value and
    Use the function INTERCEPT to return the Y-Intercept value

    For example if your x values were in A1 to A7 and your y values
    were in B1 to B7 then your formula for slope would be

    =SLOPE(B1:B7,A1:A7)

    HTH
    Martin



  3. #3
    Ardus Petus
    Guest

    Re: Trend Line - Equation

    With an UDF:
    =GetEquation("Chart 1", "Y")

    Paste the following into a standard module:

    '-----------------------------------------
    Function getEquation(sChartName As String, sSeriesName As String)
    Dim oTrendLine As Trendline
    On Error GoTo err_handler
    Set oTrendLine = ActiveSheet.ChartObjects(sChartName).Chart _
    .SeriesCollection(sSeriesName).Trendlines(1)
    getEquation = oTrendLine.DataLabel.Text
    Exit Function
    err_handler:
    getEquation = CVErr(xlErrValue)
    End Function
    '-------------------------------------------

    HTH
    --
    AP

    "Rich 80105" <[email protected]> a écrit dans le message de news:
    [email protected]...
    >I have a chart with a trendline, with the equation for the trendline
    > displayed in the chart.
    >
    > How can I either format the equation or reference thecomponents of the
    > trendline elsewhere in the spreadsheet.
    >
    > The display says y = 27.894x - 1E+06
    > and I would like to be able to at least display the second number
    > differently, and preferably be able to reference thetwo numbers
    > separately elsewhere in the spreadsheet.
    >
    > Can this be done (I am using Excel 2000)
    >
    > Thank you
    > Rich 80205




  4. #4
    Rich 80105
    Guest

    Re: Trend Line - Equation

    On Sat, 3 Jun 2006 15:18:57 +1000, "MartinW" <[email protected]>
    wrote:

    >Hi Rich,
    >
    >Your equation is in the form y = mx + c where
    >m = the gradient
    >c = Y- Intercept
    >
    >Use the function SLOPE to return the gradient value and
    >Use the function INTERCEPT to return the Y-Intercept value
    >
    >For example if your x values were in A1 to A7 and your y values
    >were in B1 to B7 then your formula for slope would be
    >
    >=SLOPE(B1:B7,A1:A7)
    >
    >HTH
    >Martin


    Thanks, just what I needed
    Rich

+ 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