# How do I generate 6 random characters (4 numerical, 2 alpha)?

1. ## How do I generate 6 random characters (4 numerical, 2 alpha)?

I need some assistance. I need to create a spreadsheet with 1 column and 4000 rows. In each cell I need 6 random characters (4 numerical and 2 alpha). Any suggestions on how I can do this in Excel 2003? Thanks!  Register To Reply

2. ## Re: How do I generate 6 random characters (4 numerical, 2 alpha)?

Hi Dcdigiacomo, welcome to the forum.

The following formula will generate random codes having 4-digits & 2 characters (always num-num-num-num-char-char). Hopefully that works for you.

=TEXT(RANDBETWEEN(0,9999),"0000")&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))

Every time the worksheet calculates these codes will change, so if you want them to remain you will have to copy them (copy A1:A4000) then select A1 and use PasteSpecial -> Values to convert the formulas to static values.  Register To Reply

3. ## Re: How do I generate 6 random characters (4 numerical, 2 alpha)? Originally Posted by Paul =TEXT(RANDBETWEEN(0,9999),"0000")&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))
Perfect! One more question. How would I modify the formula so it generates lower case characters instead of upper case?  Register To Reply

4. ## Re: How do I generate 6 random characters (4 numerical, 2 alpha)?

You would change the formula to:

=TEXT(RANDBETWEEN(0,9999),"0000")&CHAR(RANDBETWEEN(97,122))&CHAR(RANDBETWEEN(97,122))  Register To Reply

5. ## Re: How do I generate 6 random characters (4 numerical, 2 alpha)?

Awesome! Thanks for all your help and thanks from the previous user.  Register To Reply

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