+ Reply to Thread
Results 1 to 4 of 4

Macro to add numbers to create combinations that equal certain amo

  1. #1
    Lauren qt314
    Guest

    Macro to add numbers to create combinations that equal certain amo

    Thank you for your assistance.

    I receive a list of numbers, usually over one hundred items. I need to find
    out which amounts will add up to a given total. How would I create a macro
    to do this? Is there already an Excel function to do this that I have not
    found? It would need to work with currency.

    Ex: 9, 12, 7, 4, 15, 8, 10, 3 total needed 18
    Solution 8+10; 3+15


  2. #2
    Bernie Deitrick
    Guest

    Re: Macro to add numbers to create combinations that equal certain amo

    Lauren,

    With a hundred different items, there are over 2^100 possible ways to
    combine them. You would need a supercomputer - or maybe even multiple
    supercomputers. If you had fewer than 25, you could do it.

    HTH,
    Bernie
    MS Excel MVP


    "Lauren qt314" <Lauren [email protected]> wrote in message
    news:[email protected]...
    > Thank you for your assistance.
    >
    > I receive a list of numbers, usually over one hundred items. I need to

    find
    > out which amounts will add up to a given total. How would I create a

    macro
    > to do this? Is there already an Excel function to do this that I have not
    > found? It would need to work with currency.
    >
    > Ex: 9, 12, 7, 4, 15, 8, 10, 3 total needed 18
    > Solution 8+10; 3+15
    >




  3. #3
    Lauren qt314
    Guest

    Re: Macro to add numbers to create combinations that equal certain

    My group leader had a macro that would perform this function. Unfortunately,
    he walked out a few weeks ago and no one can access the program. Since it
    can rule out certain numbers, like those larger than the target number,
    automatically it would not need to combine each item. There has to be a way
    to duplicate what he did, but I am just learning how to create macros. I
    don't know where to start.

    "Bernie Deitrick" wrote:

    > Lauren,
    >
    > With a hundred different items, there are over 2^100 possible ways to
    > combine them. You would need a supercomputer - or maybe even multiple
    > supercomputers. If you had fewer than 25, you could do it.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    > "Lauren qt314" <Lauren [email protected]> wrote in message
    > news:[email protected]...
    > > Thank you for your assistance.
    > >
    > > I receive a list of numbers, usually over one hundred items. I need to

    > find
    > > out which amounts will add up to a given total. How would I create a

    > macro
    > > to do this? Is there already an Excel function to do this that I have not
    > > found? It would need to work with currency.
    > >
    > > Ex: 9, 12, 7, 4, 15, 8, 10, 3 total needed 18
    > > Solution 8+10; 3+15
    > >

    >
    >
    >


  4. #4
    Bernie Deitrick
    Guest

    Re: Macro to add numbers to create combinations that equal certain

    Lauren,

    I have a workbook that can do it for up to any number, but it gets very
    slow. If you can rule out a lot of the numbers, then you can try it.
    Contact me privately - take out the spaces and change the dot to . - and I
    will send it to you.

    HTH,
    Bernie
    MS Excel MVP


    "Lauren qt314" <[email protected]> wrote in message
    news:[email protected]...
    > My group leader had a macro that would perform this function.

    Unfortunately,
    > he walked out a few weeks ago and no one can access the program. Since it
    > can rule out certain numbers, like those larger than the target number,
    > automatically it would not need to combine each item. There has to be a

    way
    > to duplicate what he did, but I am just learning how to create macros. I
    > don't know where to start.
    >
    > "Bernie Deitrick" wrote:
    >
    > > Lauren,
    > >
    > > With a hundred different items, there are over 2^100 possible ways to
    > > combine them. You would need a supercomputer - or maybe even multiple
    > > supercomputers. If you had fewer than 25, you could do it.
    > >
    > > HTH,
    > > Bernie
    > > MS Excel MVP
    > >
    > >
    > > "Lauren qt314" <Lauren [email protected]> wrote in message
    > > news:[email protected]...
    > > > Thank you for your assistance.
    > > >
    > > > I receive a list of numbers, usually over one hundred items. I need

    to
    > > find
    > > > out which amounts will add up to a given total. How would I create a

    > > macro
    > > > to do this? Is there already an Excel function to do this that I have

    not
    > > > found? It would need to work with currency.
    > > >
    > > > Ex: 9, 12, 7, 4, 15, 8, 10, 3 total needed 18
    > > > Solution 8+10; 3+15
    > > >

    > >
    > >
    > >




+ 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