Results 1 to 10 of 10

Thread: Three Letter Combinations - how many are there?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    5

    Three Letter Combinations - how many are there?

    Hello,

    I'm trying to find a program or way in Excel in which I can get a full list of 3 letter combinations.

    Eg:

    aaa, aab, aac, aad, aae, ... etc.

    It's been boggling my mind for days now. I started to enter them in Excel but thought there must be an easier way.

    Does anyone know how I can create a full list of 3 letter combinations and how many would be on this list?

    Thank you.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Three Letter Combinations - how many are there?

    If I'm not mistaken, it's 26³ = 17,576. (Then again, maths isn't my strong point. )

    I guess you could write a program to generate them.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    5

    Re: Three Letter Combinations - how many are there?

    Yes, as you can see there are quite a lot of entries. I wouldn't know how to write such a program unfortunately...

  4. #4
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: Three Letter Combinations - how many are there?

    To do it in the cells, put 97 in A1,B1 and C1.
    In D1 put: =CHAR(A1)&CHAR(B1)&CHAR(C1)

    In A2 put =A1
    In B2 put =B1
    In C2 put =C1+1
    In D2 put =CHAR(A2)&CHAR(B2)&CHAR(C2)

    Fill down to row 26.

    In A27 put =A1
    In B27 put =B1+1
    In C27 put =C1

    Fill down to row 676

    In A677 put =A1+1
    In B677 put =B1
    In C677 put =C1

    Fill all the way down.


    You can easily set up a code loop to do this - just do exactly as I have done above but put it in a module (with appropriate syntax, of course).


    zaza
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    5

    Re: Three Letter Combinations - how many are there?

    Excellent. That is really sweet. Thanks for putting your mind to this. Much appreciated.

  6. #6

  7. #7
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: Three Letter Combinations - how many are there?

    Here's VB code that throws them into a listbox.
    Code:
    Private Sub Form_Load()
    For I = 97 To 122
        For J = 97 To 122
            For K = 97 To 122
                List1.AddItem Chr(I) & Chr(J) & Chr(K)
            Next
        Next
    Next
    MsgBox Str(List1.ListCount) & " combinations generated."
    ' returns 17576 combinations generated.
    ' aaa   shows up first
    ' aab   shows up second
    ' aac   shows up third, etc.
    End Sub
    Doctor Ed

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    5

    Re: Three Letter Combinations - how many are there?

    Thanks Code Doc! Much appreciated.

  9. #9
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: Three Letter Combinations - how many are there?

    Depends on the charactersset you use...
    Is A the Same as a?
    What about... á,ä,à,ï,1,2,3,4,5,6,7,8,9,0,!,@,#,$,%,^,&,*,(,),_,+
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

  10. #10

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    5

    Re: Three Letter Combinations - how many are there?

    You have to throw a spanner into the works don't you? Well, thank goodness it doesn't matter for my purpose.

    Cheers all and keep smiling. You've been a great help.

Posting Permissions

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



Click Here to Expand Forum to Full Width