View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson[_2_] Myrna Larson[_2_] is offline
external usenet poster
 
Posts: 124
Default Count combinations

In the past I've posted code to generate combinations. You can find it by searching Google for
posts from Myrna Larson, key words "combinations" "permutations". The message you want was
posted on July 25, 2000.

There are almost 14 million combinations of 49 items taken 6 at a time, so the code will take a
while to run (maybe hours?) There will be 214 columns of text. You'll need to split the data
from 1 column into 6 (data/text to columns) plus a 7th column for a SUM formula, so you'll need
1498 columns, which means 6 worksheets with data from ~36 columns on each.

Once you've generated the combinations, copied to multiple sheets, split into 6 numbers and done
the SUMs, you can use Data/AutoFilter to show the total you want. I hope Excel won't choke on
this amount of data. It will undoubtedly be VERY SLOW!

I presume this has something to do with the lottery? Whatever your scheme, it won't work <g.

On Mon, 08 Sep 2003 04:29:30 GMT, TwIsTeEeR wrote:

From a set of integers from 1 to 49,
take 6 unique integers,
that if we sum them up, this sum is equal to 150.

Conditions:
1. The set numbers are integers from 1 to 49
2. subset size is 6
3. sum of the selected subset numbers is 150

My questions:
A. How many sets (combinations) of 6 unique numbers exist that their sum
is 150?
B. Do you know of a function that can calculate that quantity
of combinations, for different values of conditions (1), (2), & (3)?

Thank you,