After that, the second argument ( high) is the largest number we would like to include in our random number picker, so it is the total number of names.The first argument ( low) means the smallest index in the list, which is 1. The RANDBETWEEN function has two arguments, low and high.We write a RANDBETWEEN function here to select a random number between 1 and the total number of names. And then, we need the row variable, which is the randomly picked number.We select the cells from A2 until the end of column A as our first argument in the INDEX function. First, we need to add the range of cells where the names are written. We need to give two arguments to the INDEX function.As you can see, we use the INDEX function wrapping the RANDBETWEEN function wrapping the COUNTA function. We have actively selected the cell (or box) under C2, where we want to put our randomly picked name.The function is as follows: =INDEX(A2:A, RANDBETWEEN(1, COUNTA(A2:A))) Let’s see how we can use all this to pick a random name from a long list in Google Sheets.Īs you can see in the image above, the combination of the three functions shows a randomly picked name from the list. This way, we can match the randomly picked number with its corresponding name from the list.Ī Real Example of Using RANDBETWEEN and INDEX Functions Hence, we will need to use the list of the names as reference, and then the randomly selected number as row. We want to pick a random number from a long list. column is also an optional argument, it means the number of offset column from the range.It means the number of offset row(s) from the range. reference means the range of cells where the values are located.We will have to add the arguments into it to work. Let’s dissect this thing and see what each part of this means: The syntax of the INDEX function is as follows: =INDEX(reference, row, column) The INDEX function is useful to return the content of a cell, specified by row and column offset. So we need to identify the randomly picked number and show the corresponding name of the list. Great, we know how to pick a random winner! But we need to see his name as well. This function returns a random number which we can use as the index of the selected winner. If the list of the names is in column A starting from A2, then you can write the following formula: =RANDBETWEEN(1, COUNTA(A2:A)) Therefore, we use it with a column reference that contains all the names we want to include in the calculation. It counts the number of cells in a selected range. This is why the COUNTA function is useful. However, it is highly possible that you either don’t know the exact number of names or it changes. For instance, if there are always 12 names in our list, we can write this function in the following way: =RANDBETWEEN(1, 12) We can write the exact number of participants if it is always the same. high is the high end (the biggest number) of the random range.įor example, we need a random number between 1 and the total number of names to pick a random winner.low means the low end (the smallest number) of the random range.= the equal sign is just how we start any function in Google Sheets.The syntax of the RANDBETWEEN function is as follows: =RANDBETWEEN(low, high) The RANDBETWEEN function is a random number generating function. The Anatomy of the RANDBETWEEN and INDEX Functions The Anatomy of the RANDBETWEEN Function Let’s dive right into real examples to see how to pick a random name from a long list in Google Sheets. INDEX finally to match the randomly selected number with the corresponding name in the list.RANDBETWEEN to pick a random number between 1 and the total number of participants,.COUNTA to count the number of participants in the draw,.I will show you a solution using the combination of three Google Sheets functions: Say you have a competition for your website, school, or workplace, and you need to pick a random winner from a long list. It is useful if you have a list of names in one column and want to draw between them. How to Pick a Random Name from a Long List in Google Sheets.A Real Example of Using RANDBETWEEN and INDEX Functions.The Anatomy of the RANDBETWEEN and INDEX Functions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |