+ Reply to Thread
Results 1 to 8 of 8

Calculating the Intersection of 2 lines

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    Adelaide
    MS-Off Ver
    Excel 2019
    Posts
    79

    Calculating the Intersection of 2 lines

    G'day again forum goers, once again i find myself perplexed by something that should be relatively simple, namely;

    I need to find a way of inputting the independent and dependent values that constitute a pair of lines (see attached excel document) and calculate the coordinates at the intersection of these lines automatically (in cells; D8 and D9). Since at the point of intersection, the two line equations will have the same values of x and y, the two equations equal to each other. This gives an equation with one unknown (x) which can be solved manually by rearranging to isolate the x terms however I need some kind of conditional equation that can perform the intersection calculation for a line with any slope and direction automatically (as it will need to be repeated hundreds of times).

    For the example attached the value should equate to -4 and -2

    Anyone have any ideas?

    Regards
    MattRNR
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Calculating the Intersection of 2 lines

    Hi,

    The coordinates, slope and intercept for Vector 1 do not appear to be consistent with the graphical representation, and hence also with your desired results.

    Please clarify.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Calculating the Intersection of 2 lines

    Here, I made recalculation.

    And in A column I made two intercepts:
    X->Y and Y->X

    For both lines.

    Then I use average to get interception of them.
    I think it's fine but please test it.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-01-2013
    Location
    Northampton, England
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Calculating the Intersection of 2 lines

    Hi

    Try attached, it uses MINVERSE and MMULT functions.

    Let's know how you get on.

    Alan
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-24-2012
    Location
    Adelaide
    MS-Off Ver
    Excel 2019
    Posts
    79

    Re: Calculating the Intersection of 2 lines

    Cheers for the prompt responses guys, would you be able to clarify the MINVERSE and MMULT approach Alan? I've never come across these before and i can't seem to replicate your method (see attached), I can't really wrap my head around what it is doing, or how to get it to work.

    Regards MattRNR
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-01-2013
    Location
    Northampton, England
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Calculating the Intersection of 2 lines

    MattRNR

    Hope this clears things for you.

    There's lots of online help for MINVERSE, MMULT and other array functions. Help on matrices is another matter, if you're not familiar with them you may not want to use this solution. If you do, at least satisfy yourself that solutions are correct over a good sample range.

    Let's know how you get on.

    AlanRefined example of intersection ID(2).xlsx

  7. #7
    Registered User
    Join Date
    10-24-2012
    Location
    Adelaide
    MS-Off Ver
    Excel 2019
    Posts
    79

    Re: Calculating the Intersection of 2 lines

    Cheers for the help Alan
    I’ve been reading up on the tools you suggested, admittedly I’m still having a bit of trouble wrapping my head around it. Would you be able to explain to me the steps you used to get the results you have? I hate to keep bothering you with this but I really need to figure this out to finish an analysis for my thesis and so far yours is the best solution I’ve been able to find.
    Thanks again mate
    My apologies for the late response.

  8. #8
    Registered User
    Join Date
    06-01-2013
    Location
    Northampton, England
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Calculating the Intersection of 2 lines

    Hi there

    I've attached another example sheet and a Word 2010 document which I hope helps.

    The Word doc attempts to explain what's going on. In the spreadsheet, the Basic tab allows you enter all your slope and intercept values. You can then choose which two to calculate. It automatically graphs the result.

    The With Checks tab builds in some checks and allows to you to enter limits on any of the x or y values. If not applicable then leave the minimum and maximum values clear. Checks include lines aren't parallel, if you need limits, then it also checks mimumum limit is less than maximum, that they intersect etc. Perhaps you don't need them but I wanted to look at the problem because it appealed to me.

    Good luck
    Alan
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 07-16-2013, 06:41 PM
  2. Finding the intersection of two trend lines.
    By kafansler in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-02-2013, 03:09 PM
  3. [SOLVED] How to find intersection points between lines using Excel?
    By Saurabh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2006, 12:55 PM
  4. [SOLVED] Intersection of two lines
    By akr in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-26-2006, 08:20 AM
  5. display intersection value for 2 lines
    By gab2409 in forum Excel General
    Replies: 3
    Last Post: 02-28-2005, 12:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1