Forum

slope of a line (x ...
 
Notifications
Clear all

slope of a line (x coefficient of trend line ) in chart & sheet name

4 Posts
2 Users
0 Reactions
67 Views
 m m
(@coral)
Posts: 10
Active Member
Topic starter
 

Hi every one

I want to make sheet like "result" in attached file  with columns : xutm , yutm ,and slope of trend line.i found trend line with scatter chart before in every sheets so just need to choose coefficient of x in equation for every coordinate
so please help me with macro code because i have many sheets 

thank you so much

 
Posted : 02/05/2020 1:17 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi,

Do you need the VBA to create the chart and trend line, or just get the x coefficient from the trend line on each sheet?

Regards

Phil

 
Posted : 02/05/2020 9:59 pm
 m m
(@coral)
Posts: 10
Active Member
Topic starter
 

hi again

from yesterday7 hours later up to now i  have understood that i can find slope with this

=SLOPE(INDIRECT("'"&A2&"'!R2:R19"),INDIRECT("'"&A2&"'!Q2:Q19")) 

so: A2=sheet name=utmx

in cell B2 i have to put  utmy

 and C2=SLOPE(INDIRECT("'"&A2&"'!R2:R19"),INDIRECT("'"&A2&"'!Q2:Q19")) in result sheet

but how can i get (utm x=G2=sheet name) and (utm y=H2) from all sheets and put them in to result sheet 

so then i will have result sheet with all coordinate point(x utm-y utm ) with their slope data line (in 3 columns)

i hope  i could explain well, forgive me for my weak English language

i look forward to hearing from you

thank you very much

 
Posted : 02/05/2020 11:54 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi,

The syntax for SLOPE is =SLOPE(known_ys, known_xs) so you can just get the slope from, for example,  sheet 44947 using =SLOPE('449447'!R2:R19,'449447'!Q2:Q19)

Just repeat for all sheets - see attached.

regards

Phil

 
Posted : 03/05/2020 5:25 am
Share: