+ Reply to Thread
Results 1 to 5 of 5

Selecting Cells From Column at Random for a Specific Sum Total

  1. #1
    Registered User
    Join Date
    12-01-2010
    Location
    San Jose, Costa Rica
    MS-Off Ver
    Excel 2007
    Posts
    2

    Unhappy Selecting Cells From Column at Random for a Specific Sum Total

    Hi!

    I have a column with 2156 cells in it. It's just a long, long, long list of numbers.

    My challenge:

    I need to select cells at random from this column to total a specific sum.

    E.G.

    2
    4
    7
    8
    9
    10
    12
    17
    30

    This sums 99. But let's say I only want cells that would sum 9.

    My options would be 2+7 or 9.

    I need to do this with my long long long list of numbers. I've tried googling this and the best I can find is either using the Solver add-in or something called recursion (which seems extremely complicated!).

    Does anyone know how I can do this? If I can do it with solver, how?

    Thanks,
    Anais

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Selecting Cells From Column at Random for a Specific Sum Total

    Hi there, the method not very smart but anyway, please see attachment.

    Press "Start" and input value, it works for sum of two digits.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-01-2010
    Location
    San Jose, Costa Rica
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Selecting Cells From Column at Random for a Specific Sum Total

    Is there anyway to adjust that for larger number, up to eight digits?

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Selecting Cells From Column at Random for a Specific Sum Total

    Hi there, will that digit be present in the column of digits or it might be any digit? Do you need to find all combinations or one will be enough?

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Selecting Cells From Column at Random for a Specific Sum Total

    I've set up an example of how you can use Solver to pick numbers to total a specific sum.

    But looking at solution presented by watersev it seems to me that his recursion model is superior to Solver as it is much more userfriendly and gives more information.

    Still you asked for a Solver solution so here is one.

    HTH

    Alf
    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