View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Maxi[_2_] Maxi[_2_] is offline
external usenet poster
 
Posts: 94
Default Creating combinations based on a criteria

----------------------------------------------
| 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?