Excel – Microsoft Excel: How to find the intersection of two lines

microsoft excel

I want to find the intersection of two lines.

I have two points for the first line:
A(x1,y1) B(x2,y2)
and other two points for the second line:
C(x3,y3) D(x4,y4).

Is there an Excel formula that I can use to find the intersection of the two lines (the point that connects the first line with the second one)?

I tried to find a mathematical formula, but it's a little big, so I want to avoid this approach.

Best Answer

Your problem is something I recall from algebra class many decades ago. It's called "solving an equation with two variables."

You'll want to convert your lines into formulae of the format "y = mx + b" in which m is the slope of the line and m is the y intercept. This aspect is solved at math.com, from which the following information is copied:

Every straight line can be represented by an equation: y = mx + b. The coordinates of every point on the line will solve the equation if you substitute them in the equation for x and y.

The slope m of this line - its steepness, or slant - can be calculated like this: m = change in y-value/ change in x-value

The equation of any straight line, called a linear equation, can be written as: y = mx + b, where m is the slope of the line and b is the y-intercept.

The y-intercept of this line is the value of y at the point where the line crosses the y axis.

When you've converted the lines to this format, mathplanet.com has the next sequence of steps:

Solve the systems of equations using the substitution method

y=2x+4

y=3x+2

We substitute the y in the top equation with the expression for the second equation:

2x+4 = 3x+2

4-2 = 3x-2x

2 = x

To determine the y-value, we may proceed by inserting our x-value in any of the equations. We select the first equation:

y=2x+4

We plug in x=2 and get

y=2⋅2+4=8

I don't think you'll find anything other than a mathematical formula, or a combination of formulae. I'm not sure what "a little big" means in this context, but one cannot avoid the math to solve this problem.

If your lines are parallel, you may run into a divide-by-zero error. If your lines are too short to intersect, you will get the "extended" intersection point as if the lines were of infinite length.

"math is fun!"

Related Question