I have a list of 20 unique numbers and I want to create an output of nCr rows
i.e. 20C5 = 15504 rows
Each row should have a unique combination of 5 of the numbers
i.e. in the table below row#2 is a duplicate from row#XX because they contain the same elements
ROW # | ID1 | ID2 | ID3 | ID4 | IDr |
1 | 1 | 2 | 3 | 4 | 5 |
2 | 1 | 2 | 3 | 4 | 6 |
... | ... | ... | ... | ... | ... |
XX | 2 | 1 | 3 | 4 | 6 |
I have tried with several macros and I can get to remove the duplicate pairs for the 1st iteration where there are only 2 fields but I still dont know how to remove duplication where there are more than 2 fields to search
Solved! Go to Solution.
@aguzmanf
I feel there should be a smarter way. but the result is correct.
I have also tested for 19C5 and get the correct answer 11628.