VideoPhoto

Showing posts with label symbols. Show all posts
Showing posts with label symbols. Show all posts

15 January, 2022

How to Generate Random Strings of Characters

To generate any random string of characters, including letters, digits and symbols, enter all the characters you want to use, into any cell of your worksheet. E.g., enter this sequence in cell A1:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789

and then use the following formula in any other cells to get your random strings:

=MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)&MID($A$1,RANDBETWEEN(1,62),1)

This specific formula produces 10-character string, but you can change the number of segments ( MID($A$1,RANDBETWEEN(1,62),1) ) in it, to generate string of any length, from 1 to 100 characters, and even more.

The above sequence is 62 characters long. If you want to use a different one then the number 62 in the formula must be replaced to reflect the length of your new sequence.