SOLVED
Create nCr with a single field
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
aguzmanf
5 - Atom
‎03-17-2022
01:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Labels:
- Labels:
- Macros
1 REPLY 1
21 - Polaris
‎03-17-2022
01:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
