Inside The Web
    Facebook Twitter Instagram
    Inside The Web
    • Office
      • Excel
      • Ms Word
      • OneDrive
      • Google Docs
      • Google Sheets
      • Google Drive
    • Email
      • Gmail
      • Outlook
      • Emal Etiquette
    • Office Etiquette
    • Productivity
    Inside The Web
    Home»Office»Excel»How to Generate Random Name in Excel

    How to Generate Random Name in Excel

    Asmi DhakalBy Asmi DhakalDecember 4, 2023 Excel 3 Mins Read

    When creating a lucky draw or mock data, you might end up needing to generate a random name in Excel. As for now, Excel does not have a designated function that picks random names from a specified source.

    However, you can construct custom formulas using Excel’s library functions to create such look-ups!

    We will combine Excel’s lookup, mathematical, and statistical functions to build a formula according to the size, and structure of our data.

    Generate a Random Name from a Small List

    Functions UsedTypeSyntax
    CHOOSELOOKUP & REFERENCE=CHOOSE(index_num,value1,[value_2]...)
    RANDBETWEENMATH & TRIG=RANDBETWEEN(bottom,top)

    Say, you’re organizing a lucky draw between five of your colleagues. In that case, you don’t need to write their names down in a column to create a formula.

    We’ll be creating a formula using the CHOOSE and RANDBETWEEN functions. As we want to generate a random number between five names, we’ll use RANDBETWEEN to pick a number from 1 to 5.

    Then, we will nest the formula inside CHOOSE, where we’ll be assigning a number to each name.

    In cell A1, here’s the formula we constructed:

    =CHOOSE(RANDBETWEEN(1,5),"Derek","Richard","Stacy","Samara","Lisa") //  returns value according to the index number.
    CHOOSE function to generate random names Excel

    When RANDBETWEEN returns 3, CHOOSE returns “Stacy.” You can use F9 to refresh your sheet and generate a new value.

    Generate a Random Name from a Range

    Function UsedTypeSyntax
    ROWLOOKUP & REFERENCE=ROW()
    VLOOKUPLOOKUP & REFERENCE=VLOOKUP(lookup_value,table_array,col_index_num, [range_lookup])]
    RANDBETWEENMATH & TRIG=RANDBETWEEN(bottom,top)

    For this example, we will be working on a bigger data set. In column A, I have a total of 1000 names of individuals who participated in an online lucky draw.

    Data table in Excel

    We cannot use the CHOOSE function as it is not an array function; you will have to reference each cell separately in the value section.

    As this is pretty tedious, let’s use a better lookup function like VLOOKUP. Before entering the formula, I inserted a new column on the left.

    On A1, I entered the following formula and applied it to the entire range:

    =ROW() //returns the row number of the cell.
    ROW Function Excel

    Now, enter the following formula in cell D3:

    =VLOOKUP(RANDBETWEEN(1,1000),A1:B1000,2) //returns the value adjacent to the number generated by RANDBETWEEN in range A1:B1000
    vlookup to generate random names

    When RANDBETWEEN returns 969, VLOOKUP returns “Erda Slowgrove” as a result.

    Generate Random Names using First and Last Names

    Function UsedTypeSyntax
    INDEXLOOKUP & REFERENCE=INDEX(array,row_num,[column_num)
    RANDBETWEENMATH & TRIG=RANDBETWEEN(bottom,top)
    COUNTASTATISTICAL=COUNTA(value1,[value2],...)

    If you’re looking to generate random names for mockups, your first and last names could be arranged in different columns.

    Note: This method will also work while generating random pairs!

    We will be nesting COUNTA inside RANDBETWEEN to first generate the row_num for the INDEX function.

    COUNTA will return the number of texts in the range. We will be using this value as our top value in RANDBETWEEN.

    We have 20 first and last names in columns A and B, respectively. We need to generate a formula that randomly generates a full name using one of these values.

    First and Last Names in Excel

    In cell E2, here’s the formula we entered to get a random list of full names:

    =INDEX($A$2:$A$21,RANDBETWEEN(1,COUNTA($A$2:$A$21)))&" "&INDEX($B$2:$B$21,RANDBETWEEN(1,COUNTA($B$2:$B$21)))    //returns a random concatenated value of texts in range A1:A4 and B1:B4
    Generate random names from first and last names

    Generate Random Names in Excel without Duplicates

    Function UsedTypeSyntax
    INDEXLOOKUP & REFERENCE=INDEX(array,row_num,[column_num])
    SORTBYLOOKUP & REFERENCE=SORTBY(array,by_arry1,[sort_order1],..)
    COUNTASTATISTICAL=COUNTA(value1,[value2],...)
    SEQUENCEMATH & TRIG=SEQUENCE(rows, [columns], [start], [step])
    RANDARRAYMATH & TRIG=RANDARRAY([rows],[column],[min],[max],[integer])

    If you’re creating a random group of people, you need to make sure that your formula doesn’t repeat names from the list.

    To avoid redundancy, we’ll introduce the SORTBY, RANDARRAY, and SEQUENCE functions into our formula.

    We have a list of 20 names in column A. We need to randomly select 5 individuals from the list who will be in charge of a special project. Here is how we create such a list:

    =INDEX(SORTBY(A2:A21,RANDARRAY(COUNTA(A2:A21))),SEQUENCE(5))  // returns five unique names from range A2:A21
    Generate unique list of random names
    Asmi Dhakal

      Asmi is a content writer specializing in MS Office. She loves writing Excel-related content to assist other users to learn their way around the program. She started using Excel when she first entered the industry as a marketing intern. Soon, she realized that learning the often-overlooked spreadsheet program was no piece of cake. In her articles, she attempts to brief out complex topics to help beginner to intermediate-level Excel users. Asmi uses Excel for everything, including creating a grocery list to managing her personal finance. She’s a bit dramatic when it comes to the Flash Fill feature; so much so that could write a eulogy out of it. When she’s not working, you’ll find her learning a new recipe, or cleaning up her mess (out of the failed recipe).

      Related Posts

      Excel By Nisha Gurung

      How to Compare Two Columns in Excel Using VLOOKUP

      Excel By Nisha Gurung

      How to Share Excel Files with Multiple Users

      Excel By Nisha Gurung

      How to Filter Based on a List in Excel

      Add A Comment
      Table of ContentsToggle Table of ContentToggle
      • Generate a Random Name from a Small List
      • Generate a Random Name from a Range
      • Generate Random Names using First and Last Names
      • Generate Random Names in Excel without Duplicates
      • Home
      • About Us
      • Privacy Policy
      © 2025 Inside The Web

      Type above and press Enter to search. Press Esc to cancel.