Need a formula to list possible combinations of 5 digit code

WSEmery

New Member
Joined
Aug 15, 2006
Messages
2
Hello,

I am currently working on a project that i cannot discuss at present, but i am an absolute Excel novice and my project requires some help from a pro.

What I require is a formula to calculate and list every possible combination of numbers that could be in a 5 digit code that contains any numbers between 1 and 50, but without any duplication of numbers within one set of 5 digits. e.g. a bit like lottery numbers or a safe combination.

I would imagine the total number of possible combinations is somewhere up in the millions, and as such might take quite a while to work out everyone by hand.

I hope that someone can help me or point me in the right direction of how to solve this problem.

I apologise for making this so obscure.

Many thanks

Wayne
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi Wayne, welcome to the Board!

Calculating the number of possible permutations or combinations is straightfoward.
For permutations: =PERMUT(50,5). The answer is 254,251,200
For combinations: =COMBIN(50,5). The answer is 2,118,760
You're after unique combinations -- but where you do want to store over 2 million results, and how would you reference them?

Denis
 
Upvote 0
Hi Denis,

Thanks for the warm welcome and quick reply.

I was hoping that it would be possible to store the results on either a excel spreadsheet or any other program that would make the results most easily viewable and accessible. Do you have any suggestions on how best to do this and if it is possible to make a code to list the possible combinations?
 
Upvote 0
Re: Need a formula to list possible combinations of 5 digit

... every possible combination of numbers that could be in a 5 digit code that contains any numbers between 1 and 50, but without any duplication of numbers within one set of 5 digits. e.g. a bit like lottery numbers or a safe combination.
What does the bit about numbers between 1 and 50 mean?

For example, is
12345 made up of 1, 2, 3, 4 and 5 different from
12345 made up of 12, 34 and 5?
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,312
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top