In case you’re bored stiff during your holiday, here’s a nice Excel challenge for you all.
In my newsletter for May 2019 I showed you a trick to get all possible combinations of two lists. This time I have a related problem. Suppose I have 10 ballot tickets. My job is to draw 5 random tickets from that set of 10 repeatedly until I have drawn all possible combinations:
The challenge I would like to give you all:
Please use any technique in Excel to list all possible unique combinations of ticket numbers drawn this way. Note that the order in which the tickets are drawn makes no difference and that each number can only be drawn once per set of 5. This means that a draw of (1, 2, 3, 4, 5) is considered the same as (5, 4, 3, 2, 1) or (2, 1, 3, 4, 5).
What’s in it for you?
The 5 best submissions will receive:
- Eternal fame
- A free one-year license for my RefTreeAnalyser utility
Send your solutions to firstname.lastname@example.org using this subject line: “JKPADS Combinations Challenge”
Submission ends on September 9, 2019
5 thoughts on “Combinations, Combinations. A challenge”
I’ve sent my first one. I’m sure I’ll have 4 others, so I can load those 5 licences in combination.
Note that while this returns 1, 2, 3, 4, 5 as well as say 5, 4, 3, 2, 1 I don’t believe this is outside the terms and conditions.
Perhaps I should add that I consider 1, 2, 3, 4, 5 to be the same as 5, 4, 3, 2, 1
Ah, gotcha…so every numerical combo has got to be unique, regardless of the order the various numbers in that combo are drawn. Cool, have amended and resent my PowerQuery answer. Can’t wait to see all the approaches…it’s a great challenge.
Posting code? Use <pre> tags for VBA and <code> tags for inline.