+ Reply to Thread
Results 1 to 3 of 3

Interesting Math Problem to Solve in VBA

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    39

    Interesting Math Problem to Solve in VBA

    Please, I really need help with this one, it would be of great help and I'm very interested in seeing if someone can find a solution. Any help would be great...

    I need a VBA that goes through all combinations of an array of numbers that sum to any number of another array. May sound confusing, but the concept is actually quite simple.

    Consider the data I have:

    Array 1 (Ar1): 5,10, 7, 20

    Array 2 (Ar2): 6, 13, 17, 35

    What I want:

    Deliverable Column: (10+7)=17; (10+20+5)=35

    So, I need a VBA that recognizes, and tells me, that the sum of some numbers in Array 1 equal other numbers in Array 2. By logic it would probably work like: (5+10=6->No; 5+7=6->No;5+20=6->No;5+10+7=6->No.....(until)10+7=17->YES (would then tell me the rows where I can find the numbers that sum to 17))

    Please see the attached Excel workbook for an example. By concept, this issue is very simple and should be easy to understand. But I not good at guessing sums of large arrays of data, so I need a VBA that does the legwork.

    If you have any questions, please ask... Thanks!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-11-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Interesting Math Problem to Solve in VBA

    Anyone interested in working on this?

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Interesting Math Problem to Solve in VBA

    Hey. This is certainly not the best solution. But try.
    Please Login or Register  to view this content.
    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