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.
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.
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... :ehh:
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
Re: Three Letter Combinations - how many are there?
Excellent. That is really sweet. Thanks for putting your mind to this. Much appreciated.
Re: Three Letter Combinations - how many are there?
combinations?
or Permutations.
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
Re: Three Letter Combinations - how many are there?
Thanks Code Doc! Much appreciated.
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,!,@,#,$,%,^,&,*,(,),_,+
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.