PDA

Click to See Complete Forum and Search --> : Three Letter Combinations - how many are there?


aacircle
Apr 5th, 2007, 09:58 AM
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.

penagate
Apr 5th, 2007, 10:04 AM
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.

aacircle
Apr 5th, 2007, 10:41 AM
Yes, as you can see there are quite a lot of entries. I wouldn't know how to write such a program unfortunately... :ehh:

zaza
Apr 5th, 2007, 11:13 AM
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

aacircle
Apr 5th, 2007, 11:23 AM
Excellent. That is really sweet. Thanks for putting your mind to this. Much appreciated.

NotLKH
Apr 5th, 2007, 01:27 PM
combinations?
or Permutations.

Code Doc
Apr 6th, 2007, 02:40 PM
Here's VB code that throws them into a listbox.
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

aacircle
Apr 6th, 2007, 04:45 PM
Thanks Code Doc! Much appreciated.

Dnereb
Apr 11th, 2007, 06:10 AM
Depends on the charactersset you use...
Is A the Same as a?
What about... á,ä,à,ï,1,2,3,4,5,6,7,8,9,0,!,@,#,$,%,^,&,*,(,),_,+

aacircle
Apr 11th, 2007, 10:34 AM
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.