MS Excel Query. How...
 

Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop

[Closed] MS Excel Query. How to find "m" in "y=mx+c" for a range of values

8 Posts
5 Users
0 Reactions
486 Views
Posts: 0
Free Member
Topic starter
 

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


 
Posted : 22/04/2009 8:56 pm
 mboy
Posts: 12584
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).


 
Posted : 22/04/2009 9:00 pm
Posts: 768
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.


 
Posted : 22/04/2009 9:01 pm
Posts: 1014
Free Member
 

the trend function can do this. (google it)


 
Posted : 22/04/2009 9:02 pm
 mboy
Posts: 12584
Free Member
 

Is your line a curve or is it straight?

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

😕


 
Posted : 22/04/2009 9:03 pm
Posts: 0
Free Member
Topic starter
 

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.


 
Posted : 22/04/2009 9:20 pm
Posts: 36
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"


 
Posted : 22/04/2009 9:35 pm
Posts: 0
Free Member
Topic starter
 

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


 
Posted : 22/04/2009 9:41 pm
Posts: 36
Free Member
 

My bill will be in the post.

.
.
.
.
🙂


 
Posted : 22/04/2009 9:49 pm