+ Reply to Thread
Results 1 to 5 of 5

How to find intersectin of two arrays

  1. #1
    Registered User
    Join Date
    11-07-2008
    Location
    Weaverville, CA
    Posts
    2

    How to find intersectin of two arrays

    What's the best way to find the intersection of two polynomial arrays, preferably in a user defined function so that I don't have to use lots of cells on a worksheet? Specifically, I have two x,y arrays, one which slopes from bottom left to upper right, the other that slopes from upper left to bottom right. I thought I'd use the LINEST function to find the polynomial coefficients of each array (m1, m2, ..., mn), and iterate to find the "predicted" y value based on assumed x for each array until both y values are within some reasonable error.

    The second part of this problem is, I can't get teh LINEST function to work in a user defined formula in VB for a polynomial to find the polynomial coefficients (m1, m2, ...mn). I think I'm having a problem with the use of brackets, as shown below:
    Please Login or Register  to view this content.
    Or, should I be using a regression formula to find the intersection of these two arrays?
    Last edited by VBA Noob; 11-07-2008 at 01:47 PM. Reason: Added Code Tags. Amended Move to programming also

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    For the Linset part.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-07-2008
    Location
    Weaverville, CA
    Posts
    2

    LINEST to Power in UDF

    Thanks for the tip, Andy, but I still get the same problem when I try to raise the array to a power. Any other tips?

    Also, is it possible to call Solver from a macro?

    thanks!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Post the workbook?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    This works for me whether using ranges or variant arrays loaded from range.

    Yes you can use VBA with solver. Try searching and post a new thread is still stuck.
    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)

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