+ Reply to Thread
Results 1 to 5 of 5

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

  1. #1
    Registered User
    Join Date
    07-23-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    3

    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!

  2. #2
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,824

    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.

  3. #3
    Registered User
    Join Date
    07-23-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    3

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

    Quote Originally Posted by Paul View Post
    =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?
    Last edited by Paul; 07-23-2010 at 04:19 PM.

  4. #4
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,824

    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))

  5. #5
    Registered User
    Join Date
    07-23-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    3

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

    Awesome! Thanks for all your help and thanks from the previous user.
    Last edited by Paul; 07-23-2010 at 04:19 PM. Reason: Removed quotation

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1