Home Forums Chat Forum MS Excel Query. How to find “m” in “y=mx+c” for a range of values

Viewing 9 posts - 1 through 9 (of 9 total)
  • MS Excel Query. How to find “m” in “y=mx+c” for a range of values
  • Lesanita2
    Free Member

    I have many sets of data.
    I can graph each one, do a trendline and look at its slope (by showing the equation of the linear trndline)

    Can this be done without drawing graph?

    so if I five values
    say

    5 6 7 8 9

    It would return the value 1 (as thats the average increase). Obviously my numbers are different.

    Big ask, but I know how good you are.
    Thanks for looking

    mboy
    Free Member

    Should be easy, it’s just a calculated column.

    You know Y (5,6,7,8,9 from your values above)

    You just need to reverse the calculation, so that you know what m is:

    from: y = mx + c

    to mx = y – c

    to m = (y-c)/x

    Simply put that calculation into a column in excel (assuming you have all the other data of course).

    unsponsored
    Free Member

    Is your line a curve or is it straight? I presume your trendline is a line that is drawn at a tangent to the curve.

    thomthumb
    Free Member

    the trend function can do this. (google it)

    mboy
    Free Member

    Is your line a curve or is it straight?

    y = mx + c is inherently a straight line is it not?

    😕

    Lesanita2
    Free Member

    tomthumb, looks like you’ve understood. I looked at the trend value and I got an odd result, that looked like it was trying to guess the next value.

    I’ve just tried googling. I’m not quite there yet… I’ll keep trying unless you have some more pointers.

    Thanks to all.

    Stoner
    Free Member

    if you specify a table with x values 1, 2, 3, 4 etc and next to it put your observed y values, 8, 9, 10, 11, 12 etc then the function:

    =LINEST(B1:B5,A1:A5,1)

    gives “m”

    Lesanita2
    Free Member

    Stoner, you are a star!
    Tomthumb, Thanks – I used your method and managed to bodge the result, but stoner’s is exactly what I wanted – granted I didn’t put the question quite right.

    STW does it again…. you would NOT believe what I am trying to calculate (for the Mrs’ early morning meeting)

    Thanks to all

    Stoner
    Free Member

    My bill will be in the post.

    .
    .
    .
    .
    🙂

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘MS Excel Query. How to find “m” in “y=mx+c” for a range of values’ is closed to new replies.