View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Creating combinations based on a criteria

If your numbers went up to 81,
There are 9 different ways you could select the first column, 8 ways to
select the second, 7 ways to select the 3rd

so the answer would be 9! = 362,880 in my estimation. While only having 80
numbers to choose from would lower that amount, it would still be sizable.
What would be the utility of generating and listing the possibilities?

I don't see a direct roll for Myrna's code it is primarily designed to
generate all combinations of 9 numbers from 80 - this wouldn't be feasible.
(around 232 Billion possibilities I think)

--
Regards,
Tom Ogilvy




"Maxi" wrote in message
oups.com...
----------------------------------------------
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
----------------------------------------------
| 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
----------------------------------------------
| 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
----------------------------------------------
| 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
----------------------------------------------
| 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
----------------------------------------------
| 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
----------------------------------------------
| 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
----------------------------------------------
| 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |
----------------------------------------------
| 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | |
----------------------------------------------

Please paste the above data in notepad with COURIER NEW font to view it
clearly.

I have a GRID in Excel like the one shown above. If you look at a
combination of 9 numbers " 9 17 25 33 41 49 57 65 73" You will notice
that these numbers do not intercept horizontally or vertically with any
other number within the combination.

Easier clarification: Take the first number in the combination "9" and
see vertically downwards (9th column), you would notice that any other
number from that COLUMN is not present in the combination and if you
see towards left (1st row), you would notice that any other number from
that ROW is not present in the combination

I would like to know how many such combinations of 9 could be made with
the above criteria.

Other examples for a combination of 9 numbers
2 10 21 32 40 51 61 72 80
8 9 16 33 41 49 57 65 73

I found a macro written by Myrna Larson that creates combinations. Here
is a link
http://www.mrexcel.com/board2/viewtopic.php?t=179001

Can this macro be modified to suit my needs?