+ Reply to Thread
Results 1 to 27 of 27

Find all possible combinations of letters and numbers

  1. #1
    Registered User
    Join Date
    09-08-2010
    Location
    manila, philippines
    MS-Off Ver
    Excel 2003
    Posts
    2

    Find all possible combinations of letters and numbers

    hi.. i want to find all the possible combinations of 8 characters including letters and numbers.
    The letters should be all capitalized and the combination should be letters and numbers alternately.
    This are the examples:
    C8L8J1A4
    A7C8H2I4
    Q8F9H6D9
    Q1A9C8J9

  2. #2
    Registered User
    Join Date
    08-23-2010
    Location
    Oulu,Finland
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Find all possible combinations of letters and numbers

    Well a macro to do it would produce 5.3 billion rows/cells so..

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Find all possible combinations of letters and numbers

    kala1928: how do you arrive at that?

  4. #4
    Registered User
    Join Date
    08-23-2010
    Location
    Oulu,Finland
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Find all possible combinations of letters and numbers

    Quote Originally Posted by StephenR View Post
    kala1928: how do you arrive at that?
    27 letters x 10 numbers x 27 letters x 10 numbers etc?

    if the point is to actually 'see' each unique combination

  5. #5
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Find all possible combinations of letters and numbers

    kala1928
    or 16777216 combinations be eight item
    (8)^8
    0.016 billon
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  6. #6
    Registered User
    Join Date
    09-08-2010
    Location
    manila, philippines
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Find all possible combinations of letters and numbers

    could you please teach me how to come up with the possible combinations... i don't care if it takes billions but i really need to know.. please help me and tell me the exact formula... thanks.

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Find all possible combinations of letters and numbers

    OK I'd interpreted it differently, but I see what you mean. How many versions of Excel before it can handle 5 billion cells?

    The OP needs to clarify his/her requirements.

    EDIT: that's not really an Excel question. http://en.wikipedia.org/wiki/Combination
    Last edited by StephenR; 09-08-2010 at 07:50 AM.

  8. #8
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find all possible combinations of letters and numbers

    There will be 36^8 combinations - each character can have any one of 36 values (A-Z and 0-9), so with no restraints there will be 2.8 trillion(US) combinations. They could be written to a text file, but if each row takes 8 bytes the final file will be in the region of 20Tb and if your code can generate and write 1,000 combinations per second it will take around 90 years to run (not accounting for Moore's law).

    On the other hand the code to actually generate the file is trivial, but testing it may take a while

    Edited to add: Sorry, missed the requirement to alternate between letters and numbers, that pulls the combinations down to 4.6 billion and the file size to a mere 34Gb. (Or, if the sequence can also be number, letter, number, letter then there will be 9.1Bn combinations)
    Last edited by Andrew-R; 09-08-2010 at 07:56 AM.

  9. #9
    Registered User
    Join Date
    08-23-2010
    Location
    Oulu,Finland
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Find all possible combinations of letters and numbers

    Quote Originally Posted by pike View Post
    kala1928
    or 16777216 combinations be eight item
    (8)^8
    0.016 billon
    Now this would be right if you wanted to see how many combinations there are if you are only allowed to use 8 numbers and 8 different letters. See what you did wrong there?

  10. #10
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Find all possible combinations of letters and numbers

    Or does the OP mean permutations of "C8L8J1A4"? The suspense is not quite killing me.

  11. #11
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Find all possible combinations of letters and numbers

    yes
    for any four for 26 letter 456976 combination
    for any four of 10 numbers 1000
    the combination of both
    is more than 5 billon trillon zillon

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find all possible combinations of letters and numbers

    Any one of 26 letters in odd positions = 26^4 = 456,976 permutations

    Any one of 10 digits in even positions = 10^4 = 10,000 permutations

    Total permutations = 4,569,760,000, as Andrew said.

    grifter_1229, what would you do with this list that you couldn't do without it?
    Entia non sunt multiplicanda sine necessitate

  13. #13
    Registered User
    Join Date
    09-08-2010
    Location
    Kalamazoo, MI
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Find all possible combinations of letters and numbers

    To do this you would need a lot of nested for loops.

    You'd probably want

    for (each letter in alphabet)
    for (each number 0 - 9)
    for (each letter in alphabet)
    ....
    put all variables together and put into a cell and move down a cell... repeat

    And this would be 4.6B combinations. the formula above is correct.

  14. #14
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Find all possible combinations of letters and numbers

    what's a billon trillon zillon?
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  15. #15
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find all possible combinations of letters and numbers

    I'm guessing it must be about the same number of times people have said there are 4.6 billion combinations...

    Is it bigger than a googolplex ? That's a loop I'd like to see...

  16. #16
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find all possible combinations of letters and numbers

    Quote Originally Posted by DonkeyOte View Post
    Is it bigger than a googolplex ? That's a loop I'd like to see...
    Really? Oh well, here you go, just in case you need to know the factorial of a googolplex.

    Please Login or Register  to view this content.
    Do let me know if it works properly.

  17. #17
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find all possible combinations of letters and numbers

    Could I have a Progress Bar with that please ?
    (perhaps in the form of Hangman)

  18. #18
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find all possible combinations of letters and numbers

    Your wish, etc ... coded to Microsoft standards.

    Please Login or Register  to view this content.

  19. #19
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Find all possible combinations of letters and numbers

    Andrew - I'm getting an error on the first line?

  20. #20
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Find all possible combinations of letters and numbers

    http://xkcd.com/207/
    Always entertains

  21. #21
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find all possible combinations of letters and numbers

    ha ha - that's brilliant - I love the next one on Regular Expressions...

    (hijack over)

  22. #22
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find all possible combinations of letters and numbers

    I think we should continue with the hijack. I'd imagine that by now the OP has constructed their nested loop routine and needs some light reading to occupy them while it runs.

  23. #23
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find all possible combinations of letters and numbers

    Quote Originally Posted by StephenR View Post
    Andrew - I'm getting an error on the first line?
    Yes, I've done all of the hard work, so I left defining the variable classes as an exercise for the reader.

  24. #24
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Find all possible combinations of letters and numbers

    Charlie... did you see comic 292????

    http://xkcd.com/292/

  25. #25
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Find all possible combinations of letters and numbers



    I'm glad everyone else has left the office, I laughed like a drain.
    Last edited by Cheeky Charlie; 09-15-2010 at 07:51 AM. Reason: interesting approach to English

  26. #26
    Registered User
    Join Date
    08-23-2010
    Location
    Oulu,Finland
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Find all possible combinations of letters and numbers

    Sorry guys but your googolplex loop is going to get an error (not enough mass) at some point.
    You see, there isn't enough mass in the universe to actually print all the zeroes in decimal format.

  27. #27
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find all possible combinations of letters and numbers

    Sheesh, do I have to do *everything* for you guys?

    Please Login or Register  to view this content.
    Last edited by Andrew-R; 09-15-2010 at 09:06 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1