How to select cells randomly in Excel?

Supposing you have a column of values (A1: A15) in a worksheet, and now you need to select 5 random cells of them, how could you deal with this? In this article, I will show you some tricks to select cells randomly in Excel.

Select cells randomly from a column with formula

Select cells randomly from a column with User Defined Function (UDF)

Select cells randomly from a range with Kutools for Excel good idea3


Select Range Randomly(Sort Range Randomly can quickly select or sort data randomly in a range/column/row.)

doc select randomly

arrow blue right bubble Select cells randomly from a column with formula


As the following screenshot shows, you have a range of data from A1 to A15, the Rand and Index formula can help you display the random cells in a new column. Please do as follows:

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

doc-select-cells-randomly1

1. In the adjacent cell such as B1, enter the formula =RAND(), and press the Enter key, then copy the formula to the cell B15. And the random values will be filled with the cells. See screenshot:
doc-select-cells-randomly2

2. Then in the next cell over, in this case cell C1, enter the formula =INDEX($A$1:$A$15,RANK(B1,$B$1:$B$15)).
doc-select-cells-randomly3

3. Then press Enter key, and select the cell C1, drag the fill handle to cover as many cells as desired selections. And random 5 cells of range A1:A15 have been displayed in the column C. See screenshot:
doc-select-cells-randomly4


arrow blue right bubble Select cells randomly from a column with User Defined Function (UDF)

The following VBA code also can help you to display random cells that you need.

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

1. Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following function into the Module:

Function RandomSelection(aRng As Range)
'Update20131113
Dim index As Integer
Randomize
index = Int(aRng.Count * Rnd + 1)
RandomSelection = aRng.Cells(index).Value
End Function

2. Then close the module window, and enter this function =RandomSelection($A$1:$A$15) in the cell B1. See screenshot:
doc-select-cells-randomly5

3. Press Enter key, and a random value of A1:A15 has been displayed in column B. And then drag the fill handle to cover as many cells as desired selections.doc-select-cells-randomly6

The above two methods can display the random cell values in a new column, and they are only applied for a single column range, not work for a range of cells. Kutools for Excel's Sort Range Randomly tool can help you select cells randomly in an original range conveniently.


arrow blue right bubble Select cells randomly from a range with Kutools for Excel

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

After free installing Kutools for Excel, please do as below:

1. Select the range that you want to use.

2. Apply the utility by clicking Kutools > Range > Sort Range Randomly, see screenshot:
doc select cells randomly 1

3. In the Sort Range Randomly dialog box, click Select button, and enter the number of the cells that you want to select, then check the Select Type you need. See screenshot:
doc-select-cells-randomly8

4. Then click OK or Apply, and random 10 cells have been selected in the original range. See screenshot:
doc-select-cells-randomly9

If you want to select random rows or columns, Sort Range Randomly utility also can help you.

Select random 2 rows from the selected range
doc select cells randomly 2

Select random 2 columns from selected range
doc select cells randomly 3

Advanced to select random cells, Sort Range Randomly of Kutools for Excel can sort data randomly in whole range, in each rows, in each columns and so on.
doc select cells randomly 4

Click to know more about this function.

pay attention1If you are interested in this addi-in, download the 60-days free trial.

Insert Random Data (insert random integer, date, time, string or custom list in a range.)

excel addin tool for generate random integers dates times strings custom lits

Related Article:

Randomly sort cells in a column or range


Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1 Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1 200 New Features for Excel, Make Excel Much Easy and Powerful:

  • Merge Cell/Rows/Columns without Losing Data.
  • Combine and Consolidate Multiple Sheets and Workbooks.
  • Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
  • Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

btn read more      btn download     btn purchase

Comments  

Permalink 0 Michael C. Johnson
Thanks, very helpful!
2014-01-05 02:01 Reply Reply with quote Quote
Permalink -5 Kiran
It was very helpful.
I was looking for random selection of numbers and random selection of names for performing Quality check. please help me.
2014-01-29 10:29 Reply Reply with quote Quote
Permalink -1 Zabron C. Nziku
Thanks, it was very helpful
2014-02-28 09:26 Reply Reply with quote Quote
Permalink +2 Bel Vanderploeg
i would like to sort 4 columns but only one column is sorted. Is there a way to do this?
2014-03-20 06:24 Reply Reply with quote Quote
Permalink +3 Bel Vanderploeg
I would like to random select a document with 500 items. I want to select 10 percent. There are four columns in that document. Is there a way to do this?
2014-03-20 06:25 Reply Reply with quote Quote
Permalink +4 ileana
Great info, however on my "randomly selected cells" there are duplicates... how can I prevent that from happening? I need the random selection to return unique cells
2014-09-24 17:54 Reply Reply with quote Quote
Permalink 0 msword
to do this you will need to set up a random non repeating set of numbers
I used this website to do it:

http://support.microsoft.com/kb/213290
2015-01-14 19:16 Reply Reply with quote Quote
Permalink 0 lk
Wow!!! This is really amazing!
Thanks a lot for these great tricks.
2015-03-11 14:51 Reply Reply with quote Quote
Permalink 0 K. Chris C.
Thanks. Really was a great and quick help.
2015-04-25 10:10 Reply Reply with quote Quote
Permalink 0 K. Chris C.
Thanks. Was a great and quick help.
2015-04-25 10:11 Reply Reply with quote Quote
Permalink 0 art
How to select perecent of cells randomly and replace by a specific number?
2015-09-11 18:11 Reply Reply with quote Quote
Permalink 0 #Braatsy
This one is just awesome! Exactly what I needed! Thanks!
2016-02-29 17:11 Reply Reply with quote Quote
Permalink 0 Martyn Smith
Hi I am looking to build a grid with names on the left and dates (weeks) across the top. I then need to have a function that fills in random X's on particular weeks for all names. Is this possible
2016-11-07 18:32 Reply Reply with quote Quote
Permalink 0 Vinay
Very useful, but the format of the cells has been changed and also its showing few duplicate values. Please tell me how to get it solved.
2017-01-24 10:00 Reply Reply with quote Quote

Add comment


Security code
Refresh