how to find the point of intersection
Excel : Intersection of two linear straight lines
Most of us must find intersection of two linear straight lines with pen and paper during school days. In this article, we will see how to solve it with Excel.
To find intersection of two straight lines:
- First we need the equations of the two lines.
- Then, since at the point of intersection, the two equations will have the same values of x and y, we set the two equations equal to each other. This gives an equation that we can solve for x
- We substitute that x value in one of the line equations and solve it for y
Let the lines follow a system of linear equations :
y1=m1x1+c1 and y2=m2x2+c2
Where
m1: Gradient or Slope of line1,
c1: Intercept of line1,
m2: Gradient or Slope of line2,
c2: Intercept of line2
Let the point of intersection be s and t. They must satisfy the above 2 equations.
t=m1s+c1 and t=m2s+c2 . Then m1s+c1=m2s+c2
s= (c2-c1)/(m1-m2) , t=m1*s+c1
Use SLOPE and INTERCEPT functions to replicate these equations in excel.
s=(INTERCEPT(y-values2,x-values2)-INTERCEPT(y-values1,x-values1))/(SLOPE(y-values1,x-values1)-SLOPE(y-values2,x-values2))
t =SLOPE(y-values1,x-values1)*X+INTERCEPT(y-values1,x-values1)
For example : I take the following equations :
y1 = 2.5x1 - 0.5
y2=-0.5x1+1.67
Based on the above equations i created data for y1 and y2 using same values on X1.
Download the excel file
STEP I:
To find the intersection point :
Apply the following formulae :
X=(INTERCEPT(y-values2,x-values2)-INTERCEPT(y-values1,x-values1))/(SLOPE(y-values1,x-values1)-SLOPE(y-values2,x-values2))
and Y =SLOPE(y-values1,x-values1)*X+INTERCEPT(y-values1,x-values1)
STEP II:
Insert Scatter with Straight lines chart and mark intersection point ( Right click on lines >> Format Data series >> Marker Options / Fill )
Excel : Intersection of 2 linear Straight Lines |
About Author:
Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 10 years of experience in data science. During his tenure, he has worked with global clients in various domains like Banking, Insurance, Private Equity, Telecom and Human Resource.
Next → ← Prev
how to find the point of intersection
Source: https://www.listendata.com/2012/10/excel-intersection-of-two-linear.html
Posted by: martinezishaves.blogspot.com
0 Response to "how to find the point of intersection"
Post a Comment