Gradient of Line Graph in Excel
Results 1 to 8 of 8

Thread: Gradient of Line Graph in Excel

  1. #1
    Join Date
    Aug 2001
    Location
    Glasgow
    Posts
    46

    Unhappy Gradient of Line Graph in Excel

    Does anybody know if it is possible in Excel 2000 to determine the gradient of a line graph with the equation y=mx+c???

    A trendline will provide the corresponding formula, but it isn't accurate enough.

    Cheers

  2. #2
    Join Date
    Mar 2000
    Location
    San Bernardino, CA, USA
    Posts
    1,084
    Obviously, you know enough algebra to be aware that in "y=mx+c" the "m" is the "slope" of the line.

    So what do you mean when you say "gradient"?

  3. #3
    Join Date
    Aug 2001
    Location
    Glasgow
    Posts
    46
    Cheers Bill, I was asking this on behalf of a colleague.

    Apparently he doesn't actually know the equation (although his question didn't make that apparent) but he would like to know the gradient. He was hoping Excel might be advanced enough to be able to calculate it.

  4. #4
    Join Date
    Mar 2000
    Location
    San Bernardino, CA, USA
    Posts
    1,084
    The slope of a line in a coordinate plane can be calculated by...

    (vertical coordinate of second point minus vertical coordinate of first point) all divided by (horizontal coordinate of second point minus horizontal coordinate of first point)

    Unfortunately, I don't know if Excel will calculate that for you.

    I'll see if I can find it.

  5. #5
    Join Date
    Aug 2001
    Location
    Glasgow
    Posts
    46
    Thanks, I appreciate your help.

  6. #6
    Join Date
    Mar 2000
    Location
    San Bernardino, CA, USA
    Posts
    1,084
    This is what I did in Excel 2002 (aka Excel XP). I'm not sure if it is the same in Excel 2000 or Excel 97.

    I created a set of data that I knew would create a linear graph with a slope of 2 and a vertical axis intercept of 3, and then used the chart wizard to create that graph.

    Right-click on the line (the graph).
    From the context-sensitive menu, selct "Add Trendline..."
    When the Add Trendline box appears, select the Options tab.
    Check the box that says,"Display equation on chart".
    Click OK.
    The equation of the trendline will now be displayed. Since the trendline for a linear graph is the very same line, the equation of the trendline is (conveniently) the equation of the line itself.

    The equation of the trendline is displayed in the form y=mx+c, and m=the slope, or gradient.

    Mine was y=2x+3, just as I expected it to be.

  7. #7
    Join Date
    Aug 2001
    Location
    Glasgow
    Posts
    46
    Thank you very much, my colleague thinks this will help him.

  8. #8
    Join Date
    Mar 2000
    Location
    San Bernardino, CA, USA
    Posts
    1,084
    Pleased to assist one of our mates across the water!

    Good night.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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