How to Select a Random Sample in Google Sheets
To select a random sample in Google Sheets, you can use the RAND
or RANDBETWEEN
functions in combination with sorting and filtering. Here's a step-by-step guide on how to select a random sample:
- Open your Google Sheet with the data you want to sample from.
- In an empty column, insert the
RAND()
function in the first cell of the data row. This function generates a random number between 0 and 1. For example, if your data starts in row 2, insert=RAND()
in the first cell of row 2 in an empty column. - Copy the formula and paste it in the rest of the cells in the column corresponding to your data rows.
- Now you need to sort the data based on the random numbers generated. Click on the column header with the random numbers to select the entire column.
- Click on "Data" in the top menu, then click on "Sort sheet A-Z" or "Sort sheet Z-A" to sort the data based on the random numbers. This will shuffle your data randomly.
- After sorting the data, you can select the desired sample size by selecting a specific number of rows from the top of your data.
Example
Let's say you have a dataset of 100 rows (from A2 to A101) and you want to select a random sample of 10 rows.
- In cell B2, insert the
=RAND()
function. - Copy the formula in B2 and paste it in cells B3 to B101.
- Click on the column header "B" to select the entire column.
- Click on "Data" in the top menu, then click on "Sort sheet A-Z" or "Sort sheet Z-A" to sort the data based on the random numbers.
- After sorting, select the first 10 rows of data (from A2 to A11) as your random sample.
Did you find this useful?