How to generate random number without duplicates in Excel?
In many cases, you may want to generate random numbers in Excel? But with the general formulas to randomize numbers, there may be some duplicate values. Here I will tell you some tricks to generate random numbers without duplicates in Excel.
Generate unique random numbers with formulas
Generate unique random number with Kutools for Excel’s Insert Random Data (Easy!)
Easily Insert Random Data without duplicates in a range of cells |
If you want to insert random and no duplicate integer numbers, dates, times or strings, even custom lists into a range of cells, the forumula maybe hard to remember. But Kutools for Excel's Inser Random Data can quickly handle these jobs as easily as possible. Click for full features 30 days free trial! |
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. |
Generate unique random numbers with formulas
To generate the unique random numbers in Excel, you need to use two formulas.
1． Suppose you need to generate random numbers without duplicates into column A and column B, now select cell E1, and type this formula =RAND(), then press Enter key, see screenshot:
2. And select the whole column E by pressing Ctrl + Space keys simultaneously, and then press Ctrl + D keys to apply the formula =RAND() to the whole column E. See screenshot:
3. Then in the cell D1, type the maximum number of your needed random number. In here case, I want to insert random numbers without repeated between 1 and 50, so I will type 50 into D1.
4. Now go to Column A, select cell A1, type this formula =IF(ROW()-ROW(A$1)+1>$D$1/2,"",RANK(OFFSET($E$1,ROW()-ROW(A$1)+(COLUMN()-COLUMN($A1))*($D$1/2),),$E$1:INDEX($E$1:$E$1000,$D$1))), then drag the fill handle to next column B, and drag down the fill handle to the range you need. See screenshot:
Now, in this range, the random numbers you need are no repeated.
1. In the above long formula, A1 indicates the cell you use the long formula, D1 indicates the maximum number of the random number, E1 is the first cell of column you apply formula =RAND(), and 2 indicates you want to insert random number into two columns. You can change them as your need.
2. When all the unique numbers are generated into the range, the redundant cells will be shown as blank.
3. With this method, you just can generate random number start from number 1. But with the second way, you can easily specify the random number range.
Generate unique random number with Kutools for Excel’s Insert Random Data
With above formulas, there are too much inconvenience to handle. But with Kutools for Excel’s Insert Random Data feature, you can quickly and easily to insert the unique random numbers as your need which will saves a lot of time.
After installing Kutools for Excel, please do as below:（Free Download Kutools for Excel Now!)
1. Select the range you need to generate random numbers, and click Kutools > Insert > Insert Random Data. See screenshot:
2. In the Insert Random Data dialog, go to the Integer tab, type the number range you need into the From and To text boxes, and remember to check Unique values option. See screenshot:
3. Click Ok to generate the random numbers and exit the dialog.
Insert Random Data Without Duplicate
Quickly Insert multiple checkboxes or buttons into a range of cells in worksheet |
In Excel, you only can insert one checkbox/button into a cell once time, it will be troublesome if there are multiple cells needed to be inserted checkboxes/buttons at the same time. Kutools for Excel has a powerful utility -- Batch Insert Check Boxes / Batch Insert Option Buttons can insert checkboxes/buttons into the selected cells with one click . Click for full-featured free trial in 30-day! |
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. |
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
- Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
- Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
- Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
- Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
- Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
- Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
- Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
- Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
- More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!