Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ann ann is offline
external usenet poster
 
Posts: 210
Default random letter generation

i'm trying to do a random letter generation, can this be done with a formula?
i need 3 random letters, which don't repeat and cannot include vowels - so
only 21 letters. or, can i use the random number generator somehow?
tia
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default random letter generation

Ann,

In cells A1:A21 enter your letters B - Z.
In cells B1:B21 enter the formula
=RAND()
In cell C1, enter the formula
=INDEX($A$1:$A$21,MATCH(LARGE($B$1:$B$21,ROW(A1)), $B$1:$B$21,FALSE))
and copy down to C2:C3.

Press F9 to get a new batch of letters...

Bernie
MS Excel MVP


"Ann" wrote in message
...
i'm trying to do a random letter generation, can this be done with a formula?
i need 3 random letters, which don't repeat and cannot include vowels - so
only 21 letters. or, can i use the random number generator somehow?
tia



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ann ann is offline
external usenet poster
 
Posts: 210
Default random letter generation

thanks! is there an easy way to get the 3 letters in 1 cell?

"Bernie Deitrick" wrote:

Ann,

In cells A1:A21 enter your letters B - Z.
In cells B1:B21 enter the formula
=RAND()
In cell C1, enter the formula
=INDEX($A$1:$A$21,MATCH(LARGE($B$1:$B$21,ROW(A1)), $B$1:$B$21,FALSE))
and copy down to C2:C3.

Press F9 to get a new batch of letters...

Bernie
MS Excel MVP


"Ann" wrote in message
...
i'm trying to do a random letter generation, can this be done with a formula?
i need 3 random letters, which don't repeat and cannot include vowels - so
only 21 letters. or, can i use the random number generator somehow?
tia




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ann ann is offline
external usenet poster
 
Posts: 210
Default random letter generation

nevermind i got it. thanks

"Ann" wrote:

thanks! is there an easy way to get the 3 letters in 1 cell?

"Bernie Deitrick" wrote:

Ann,

In cells A1:A21 enter your letters B - Z.
In cells B1:B21 enter the formula
=RAND()
In cell C1, enter the formula
=INDEX($A$1:$A$21,MATCH(LARGE($B$1:$B$21,ROW(A1)), $B$1:$B$21,FALSE))
and copy down to C2:C3.

Press F9 to get a new batch of letters...

Bernie
MS Excel MVP


"Ann" wrote in message
...
i'm trying to do a random letter generation, can this be done with a formula?
i need 3 random letters, which don't repeat and cannot include vowels - so
only 21 letters. or, can i use the random number generator somehow?
tia




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default random letter generation

nevermind i got it. thanks

Good. And you're quite welcome.

Bernie




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default random letter generation

I'm not sure how you plan to use the generated letter triplets, but the
RAND() function that generates random numbers for use in a worksheet formula
will generate new values when anything is done to the worksheet that forces
a recalculation, so any letter triplets generated as a result of its use
will not be fixed and unchanging. Your best bet if you want fixed,
unchanging letter triplets is to use a macro. Right-click the worksheet tab
you want this functionality on and select View Code from the popup menu that
appears, then copy/paste the following code into the code window that
appeared...

Sub ThreeRandomLetters()
Dim X As Long
Dim Letter As String
Dim Triplet As String
Dim AvailableLetters As String
Randomize
AvailableLetters = "BCDFGHJKLMNPQRSTVWXYZ"
For X = 1 To 3
Letter = Mid(AvailableLetters, Int(Len(AvailableLetters) * Rnd + 1), 1)
Triplet = Triplet & Letter
AvailableLetters = Replace(AvailableLetters, Letter, "")
Next
ActiveCell.Value = Triplet
End Sub

Okay, now go back to the worksheet, press Alt+F8, select the
ThreeRandomLetters macro from the list and run it. Each time you do that, a
random, non-repeating letter triplet will be placed in whatever cell is
active at the time.

Rick


"Ann" wrote in message
...
i'm trying to do a random letter generation, can this be done with a
formula?
i need 3 random letters, which don't repeat and cannot include vowels - so
only 21 letters. or, can i use the random number generator somehow?
tia


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Random List Generation carl Excel Worksheet Functions 4 May 23rd 06 02:18 PM
Random Date Generation TNMAN Excel Worksheet Functions 5 November 3rd 05 11:56 AM
Random Name Generation pkbro Excel Worksheet Functions 1 June 21st 05 02:03 AM
Random Timetable Generation Boris Excel Worksheet Functions 7 January 28th 05 04:03 AM
random number generation kurtrambis Excel Worksheet Functions 1 November 1st 04 09:23 PM


All times are GMT +1. The time now is 11:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"