In this article, you will learn 5 different ways to generate a random string from a list in Excel with ease.
Download Practice Workbook
You can download the Excel file from the following link and practice along with it.
5 Ways to Generate Random String from a List in Excel
1. Use INDEX & RANDBETWEEN Functions to Generate a Random String from a List
I will show you to use a formula using the INDEX and RANDBETWEEN functions to generate a random string from a list.
❶ First, insert the following formula in cell D5.
=INDEX($B$5:$B$12,RANDBETWEEN(5,ROWS($B$5:$B$12)))
❷ Then press the ENTER button.
❸ After that drag the Fill Handle icon from cell D5 to D7.
So, you will get some random strings generated out of a list.
Formula Breakdown
➤ ROWS($B$5:$B$12)
Here, the ROWS function counts the row numbers from $B$5 to $B$12.
➤ RANDBETWEEN(5,ROWS($B$5:$B$12))
The RANDBETWEEN function creates some random number between 5 and the value returned from ROWS($B$5:$B$12).
➤ INDEX($B$5:$B$12,RANDBETWEEN(5,ROWS($B$5:$B$12)))
The INDEX function generates some random strings from the range $B$5:$B$12.
Read More: Random Selection from List with No Duplicates in Excel (5 Cases)
2. Extract a Random String from a List in Excel Using INDEX & RANK.EQ Functions
Here, I will show you to write a formula with the INDEX and RANK.EQ functions to extract a random string from a list in Excel.
❶ First of all, insert the following formula in cell E5.
=INDEX($B$5:$B$12,RANK.EQ(C5,$C$5:$C$12),1)
❷ Then hit the ENTER button.
❸ Drag the Fill Handle icon from cell E5 to E7.
Now you will see 3 random strings extracted from the List column.
Formula Breakdown
➤ RANK.EQ(C5,$C$5:$C$12)
The RANK.EQ function generates a ranking of numbers from the range $C$5:$C$12.
➤ INDEX($B$5:$B$12,RANK.EQ(C5,$C$5:$C$12),1)
The INDEX function generates some random strings from the range $B$5:$B$12.
Read More: How to Make a Random Selection from List Without Repetition in Excel
3. Combine CHOOSE & RANDBETWEEN Functions to Produce Random Strings from a List
In this section, I will use the CHOOSE & RANDBETWEEN functions to produce some random strings from a list.
❶ At first, insert the following formula in cell D5.
=CHOOSE(RANDBETWEEN(1,6),$B$5,$B$6,$B$7,$B$8,$B$9,$B$10)
❷ Then hit the ENTER button.
❸ Now drag the Fill Handle icon from cell D5 to D7.
After that, you will see three random strings have been pulled out of the Product List column.
Formula Breakdown
➤ RANDBETWEEN(1,6)
Here, the RANDBETWEEN function generates a random number between 1 to 6.
➤ CHOOSE(RANDBETWEEN(1,6),$B$5,$B$6,$B$7,$B$8,$B$9,$B$10)
The CHOOSE function chooses a cell in the range B5 to B10 based on the value returned by RANDBETWEEN(1,6).
Read More: Random Selection Based on Criteria in Excel (3 Cases)
4. Generate Random Strings from a List with TEXTJOIN, INDEX, & RANDARRAY Functions in Excel
In this method, I will make a formula with the TEXTJOIN, INDEX, and RANDARRAY functions to generate random strings from a list.
❶ First, insert the following formula in cell D5.
=TEXTJOIN("",1,INDEX($B$5:$B$12,RANDARRAY(4,1,1,7,TRUE)))
❷ Then press the ENTER button.
❸ Drag the Fill Handle icon from cell D5 to D7.
Finally, you will see some random strings generated from the List column.
Formula Breakdown
➤ RANDARRAY(4,1,1,7,TRUE)
Here, the RANDARRAY function generates 4 random numbers between 1 to 7.
➤ INDEX($B$5:$B$12,RANDARRAY(4,1,1,7,TRUE))
The INDEX function returns data from the range $B$5:$B$12 based on the number returned from RANDARRAY(4,1,1,7,TRUE).
➤ TEXTJOIN(“”,1,INDEX($B$5:$B$12,RANDARRAY(4,1,1,7,TRUE)))
The TEXTJOIN function merges the 4 letters returned by INDEX($B$5:$B$12,RANDARRAY(4,1,1,7,TRUE)).
Read More: How to Select Random Sample in Excel (4 Methods)
5. Use VLOOKUP & RANDBETWEEN Functions to Produce Random Strings from a List in Excel
Here, I will create a formula using the VLOOKUP & RANDBETWEEN functions to produce some random strings from a list in Excel.
To demonstrate, I have used an Excel Table here named “Tbl”.
❶ At first, insert the following formula in cell E5.
=VLOOKUP(RANDBETWEEN(MIN(Tbl[No.]),MAX(Tbl[No.])),Tbl,2,0)
❷ Then press the ENTER button.
❸ Drag the Fill Handle icon from cell E5 to E7.
After that, you will see the random strings generated from the Product column.
Formula Breakdown
➤ RANDBETWEEN(MIN(Tbl[No.]),MAX(Tbl[No.]))
Here, the RANDBETWEEN function returns a random number between the minimum and maximum value returned by MIN(Tbl[No.]) and MAX(Tbl[No.]) respectively.
➤ VLOOKUP(RANDBETWEEN(MIN(Tbl[No.]),MAX(Tbl[No.])),Tbl,2,0)
The VLOOKUP function extract a string based on the value returned by RANDBETWEEN(MIN(Tbl[No.]),MAX(Tbl[No.])). The extraction is done from the 2nd column of the a table named Tbl.
Read More: Excel VBA: Random Selection from List (3 Examples)
Practice Section
You will get an Excel sheet like the following screenshot, at the end of the provided Excel file. Where you can practice all the methods discussed in this article.
Conclusion
To sum up, we have discussed 5 ways to generate a random string from a list in Excel. You are recommended to download the practice workbook attached along with this article and practice all the methods with that. And don’t hesitate to ask any questions in the comment section below. We will try to respond to all the relevant queries asap. And please visit our website Exceldemy to explore more.