All combinations of 5 numbers from 1 to 35

Copper Contributor

Hi, I am trying to get all the combinations one can fine from 1 to 35 by sets of 5 and in order.

I would also like to have them separated by column, example

1 2 3 4 5

1 2 3 4 6

1 2 3 4 7

Google told me there are 324,632 combinations, but I am not sure. I would like to have all of them in an excel sheet. I also would love to learn the steps to eventually do it on my own, a video would be nice.  Thanks 

3 Replies

@Marco365 

I had an old workbook lying around that does this using VBA. You'll have to allow macros.

 

Others will undoubtedly post a dynamic array formula using the new functions available in Microsoft 365.

@Hans Vogelaar  I tried to ignore this but in the end I couldn't let you down.  Attached is a recursive LAMBDA function

@mtarler 

Great to see that this is possible with Lambda. Thanks!