I was wondering if there is a function, or combination of functions (maybe it requires VBA) in Excel that will help me solve the following problem:
There are 8 people in the group. I need to figure out and display all of the possible, non-repeating combinations created when 4 people are selected out of the 8. The order of the selected individuals isn’t important. I just need to find all of the unique combinations.
For example: The 8 people are Bob, Carol, Ted, Alice, Reed, Sue, Johnny, Ben (Cells A1 through A8 each contain one of the names).
One combination is Bob, Ted, Reed, Johnny. For my problem the order of the names isn’t important meaning Bob, Ted, Reed, Johnny is the same as Ted, Bob, Johnny, Reed. So any combination of those 4 people counts as one instance.
I’m not just trying to figure out how many combinations are possible. I need to actually see the possible combinations.
I built a binary evaluator:
You can use it like this
It will debug in the immediate window
Not tested, but if I understood your question right I think this should do it:
Usage:
Call combinationEnumeration("A;B;C;D;E;F;G;H", 4)
EDIT: Fixed small error. Code is correct now and outputs the expected number of results. You will get 70 lines, which you can double check by solving the binomial
C(8,4)
: http://www.wolframalpha.com/input/?i=c%288%2C4%29.=COMBIN(number, number_chosen)