Let’s understand how to generate random string in excel.
We will see how to generate random strings in excel with the help of RANDBETWEEN and CHAR function in excel.
CHAR function returns the character equivalent of a number in excel.
RANDBETWEEN function returns a random number between the limit specified in the formula.
In excel the character code of letter A is 65 and character code of Z is 90 that’s why we have used 65 and 90 so that the letter generated is between A and Z
Step 1
Select the range which you want to fill with random string.
Step 2
Press F2 to enter the formula =CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))& CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))
We will generate random string of the length 4 that’s why I have concatenated the formula 4 times, if we wanted to have string of length 7 we would repeat the formula 7 times with concatenation operator “&” between them.
Step 3
Press Ctrl+Enter to populate the formula in the selected range.
Step 4
Now copy the range and paste special as values as shown below.
Hope this helped.