+ Reply to Thread
Results 1 to 7 of 7

How to generate unique random alphanumeric 32 character codes?

  1. #1
    Registered User
    Join Date
    01-22-2014
    Location
    Finland
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to generate unique random alphanumeric 32 character codes?

    Hi all,

    I would need to generate unique random alphanumeric 32 character codes in Excel 2007. Preferably by using a formula, because I'm not that familiar with vba macros yet, but vba solution for this would also be much appreciated.

    Moreover, if possible I would also need to add 7-16 prefixed characters in front of the 32 character code.

    Regards

    Jussi

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to generate unique random alphanumeric 32 character codes?

    Try this...

    =CONCATENATE(CHAR(RANDBETWEEN(65,90)),RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9),CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(0,9))


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: How to generate unique random alphanumeric 32 character codes?

    in column A type out your selection of numbers and characters to pick from,

    Then:
    =INDEX(A1:A36,randbetween(1,36))
    would give you a random character from that column.

    put that in 32 columns and then use the concatenate function to put it into one string in a cell, you can hide all the "helper" columns if neccessary.

    It won't test for "uniqueness" but I can't imagine that would be a problem, the chances of getting the same result twice must be pretty much impossible, or at least a bigger number than I can give a name to.

  4. #4
    Registered User
    Join Date
    01-22-2014
    Location
    Finland
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to generate unique random alphanumeric 32 character codes?

    Thanks, this works almost as I want it to.

    To clarify a bit my situation. I need to create these unique codes for FX trade contracts and when those are reported to a third party each trade should have a unique code. When using the formula above, it does generate exactly the 32 character code that I need, but when I paste the formula to new cells, this formula generates new codes to all cells, not only to the new cell to which I paste the formula.

    So is there a way that the old codes would remain the same, and the new codes that are generated would check those earlier generated codes in order not to create the same code. I know that it's almost impossible to have exactly same code, but if it's possible make sure of this it would be great.

    Regards

    Jussi

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to generate unique random alphanumeric 32 character codes?

    You can use my suggested method for limited number of cells don't depend it for huge number of cells since it may create duplicates.

    You have to copy paste the formula cells to Values so that the previously generated numbers will not get changed.

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: How to generate unique random alphanumeric 32 character codes?

    when you generate a code, copy and paste special - values.

    I really don't think it's neccessary to check if it's unique there must be around
    1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
    possibilities.

  7. #7
    Registered User
    Join Date
    01-22-2014
    Location
    Finland
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to generate unique random alphanumeric 32 character codes?

    Thanks for both of you! I'll create the list of codes by using one of these suggestions and see if my boss approves

    Regards,

    Jussi

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula to generate unique random numbers?!?
    By aims in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-07-2013, 03:14 PM
  2. Replies: 1
    Last Post: 01-22-2013, 07:02 AM
  3. Generate unique random alphabets for 35 characters in length
    By promo786 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-13-2011, 11:10 PM
  4. Replies: 7
    Last Post: 09-01-2007, 04:29 PM
  5. [SOLVED] generate unique random numbers
    By Stephen Larivee in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 03-28-2006, 08:10 PM

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