Compare combinations of values/transactions

  • I need to compare in and out of money in multiple bank accounts.
    Imagine this:


    Imagine in row one i have all the "INs"
    and in row two i have all the "OUTs"


    now, how do i compare say first transaction in row one to say 5 transactions in row 2 and find the relationship
    It can be:


    1. Transaction IN 1 = Transaction OUT 3
    2. Transaction IN 1 = Transaction OUT 2+4
    3. Transaction IN 1 = Transaction OUT 3, or Transaction OUT 2+4


    So if its a direct relation it just displays where they are equal, if they aren't how it will display which multiple transactions will be equal, and if there are 2 different possibilities it will show both answers.


    Any tips how to do this efficiently?
    If its only In = Out its pretty straight forward, but how do i code it to search for combinations of transactions say 1+2+5 efficiently.



    Please help me out

  • Re: Compare combinations of values/transactions


    Hi herbds7, thank you for the solution you sent.


    One question, why does it crash if i set SSum to be less than 10?

  • Re: Compare combinations of values/transactions


    Don't know since I did not write the code,
    but I expect it to fail if you set the sum below the smallest input.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!