I am not aware of a single, simple formula for this kind of thing.
It seems that most attempts at generating combinations/permutations involve nested For...Next loops.
For i1=1 to 9
For i2=i1+1 to 9
For i3=i2+1 to 9
...
store permutation/combination
...
next i3
next i2
next i1
I tried setting up a spreadsheet to do it with just spreadsheet functions here: https://www.excelforum.com/tips-and-...thout-vba.html It works pretty well for permutations. When I have thought about using this to generate combinations without repeats, I usually end up with something that generates every permutation then uses appropriate functions/logic to reject permutations that don't match the desired conditions. Recognize that, if pick 7 from 9 yields more than 1E6 possible permutations, it won't readily fit on a single tab/sheet because there are only about 1E6 rows to a spreadsheet (you may need to use multiple columns/tabs/sheets).
It's not a specific solution to your specific scenario, but I would expect to adapt one of those approaches to your problem.
Bookmarks