![]() |
random alphanumeric string
Doe anyone know of a way to generate an alphanumeric string?
|
Answer: random alphanumeric string
Yes, Microsoft Excel has a built-in function that can generate random alphanumeric strings. The function is called
Formula:
Here's how you can use the Formula:
The above formula generates a string that contains two uppercase letters, two digits, and two lowercase letters. You can modify the formula to generate a string of different length or with different combinations of characters. Note that the Formula:
Formula:
Formula:
|
For a start
=CHAR(INT(RAND()*26+65))&CHAR(INT(RAND()*26+65))&C HAR(INT(RAND()*26+65)) this is easier and better done with macro code (VBA), but this is the worksheet function group. HTH. Best wishes Harald " skrev i melding ... Doe anyone know of a way to generate an alphanumeric string? |
One way is to use RANDBETWEEN and CHAR(),
numbers are 47-59 and letters (cap) from 65-90. So you might want to use a formula like this: =CHAR(CHOOSE(RANDBETWEEN(1,2),RANDBETWEEN(48,57),R ANDBETWEEN(65,90))) which will randomly give you a number or capital letter.. copy it to as many columns as you like, then create some formula like =A1&B1&C1&D1&E1 to join them together (in that case a 5 character random alphanumeric string). " wrote in message ... Doe anyone know of a way to generate an alphanumeric string? |
Typo....numbers are 48-57, as in the formula.
"Dave R." wrote in message ... One way is to use RANDBETWEEN and CHAR(), numbers are 47-59 and letters (cap) from 65-90. So you might want to use a formula like this: =CHAR(CHOOSE(RANDBETWEEN(1,2),RANDBETWEEN(48,57),R ANDBETWEEN(65,90))) which will randomly give you a number or capital letter.. copy it to as many columns as you like, then create some formula like =A1&B1&C1&D1&E1 to join them together (in that case a 5 character random alphanumeric string). " wrote in message ... Doe anyone know of a way to generate an alphanumeric string? |
All times are GMT +1. The time now is 02:58 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com