+ Reply to Thread
Results 1 to 7 of 7

Generate random 6-16-byte random hexadecimal number

  1. #1
    Registered User
    Join Date
    09-10-2010
    Location
    Orange, CA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Generate random 6-16-byte random hexadecimal number

    Hello,

    Is it possible for Excel to generate random 16-byte hexadecimal numbers that would not be repeated? Also, would I be able to select how many bytes I need the random number to be...selectable from 6-16? I most likely only need 16-byte, but just in case I want a smaller passcodes.

    If not, does anyone know of a program that will do it easily?

    Thank you!
    Last edited by jsamuelshn; 09-20-2010 at 08:13 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Generate random 6-16-byte random hexadecimal number

    = DEC2HEX(RANDBETWEEN(0, 2^16), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16), 4)


    Each one adds two bytes.
    Last edited by shg; 09-20-2010 at 06:40 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-10-2010
    Location
    Orange, CA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: Generate random 6-16-byte random hexadecimal number

    Thank you shg!

    Does this only work on version 2007? I tried inputting this formula in my 2003 Excel and I just get #NAME in the box. What does the ,4 mean?

    Thanks again!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Generate random 6-16-byte random hexadecimal number

    Pre 2007, Tools > Add-Ins, tick Analysis Toolpak

    After you get that working, post back if Help doesn't answer your other question.

  5. #5
    Registered User
    Join Date
    09-10-2010
    Location
    Orange, CA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: Generate random 6-16-byte random hexadecimal number

    Thanks again shg!

    That works perfectly.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Generate random 6-16-byte random hexadecimal number

    That should be ...

    = DEC2HEX(RANDBETWEEN(0, 2^16 - 1), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16 - 1), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16 - 1), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16 - 1), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16 - 1), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16 - 1), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16 - 1), 4)
    & DEC2HEX(RANDBETWEEN(0, 2^16 - 1), 4)


    ... or

    = DEC2HEX(RANDBETWEEN(0, 2^32 - 1), 8)
    & DEC2HEX(RANDBETWEEN(0, 2^32 - 1), 8)
    & DEC2HEX(RANDBETWEEN(0, 2^32 - 1), 8)
    & DEC2HEX(RANDBETWEEN(0, 2^32 - 1), 8)
    Last edited by shg; 07-20-2012 at 11:03 AM.

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Generate random 6-16-byte random hexadecimal number

    I think, based on jsamuelshn's last post (almost 2 years ago), that it's safe to mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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