

The =RANDBETWEEN function creates a random number within the range you designate. Generating a Random Number within a Designated Range

Ī random number appears in the desired cell(s). If you have selected multiple cells, press +. If you have selected only one cell, press. Select the cell(s) in which you want to create a random number. The =RAND() function creates a random number between 0 and 1 in the cell(s) you specify. Select your sample by selecting the number of rows for the desired sample size. Your data is in order by the random numbers. HINT: This column contains the formulas, which are no longer needed.Įxcluding title cells, select all of your data.įrom the Sort By pull-down menu, select Column A. The numbers will not match the values in Column A.

Place your insertion point in the first cell at the top of Column B.įrom the Edit menu, select Paste Special.Ĭolumn B now contains random numerical values that can be sorted. Select all of the cells containing the random numbers that have just been generated. HINT: If the Formula bar is not visible, from the View menu, select Formula Bar.Ĭolumn A now displays random numbers corresponding to each row.Įach cell, however, contains a formula and cannot be sorted. In Column A, select the rows of cells you would like to assign a random number to.ĮXAMPLE: If your data vertically spans 390 rows, select cells A2 through A390, but do not highlight the title cell A1. If Column A is not already empty, add a column to the left of it. Then you will copy and paste the random values to another column, which you will then sort in ascending order. When selecting a random sample from a collection of data you must first assign a random number to each row. By using this feature, you can assign a random number to each row in a set of data and sort them randomly. This article is based on legacy software.Įxcel has the ability to generate random numbers from zero to one or from pre-selected number ranges. (Archives) Microsoft Excel 2007: Getting a Random Sample Mac
