5 Ways to Generate Random Numbers in Excel

Not every user will have a need for random numbers in Excel. Most people work with fixed numbers and formulas and may have no need for random numbers to appear in their reports.

However, a random number generator does have a huge use when working with different scenarios on a set of data or when performing various statistical analyses.

A financial model may use a stochastic simulation that is dependent on probabilities. The model may need to be run thousands of times, but with the random number generator providing the parameters of each simulation.

Whatever your need for random numbers, Excel has several ways to generate them.

In this post, I’ll show you all the methods you can use to insert random numbers into your workbooks.

Generate Random Numbers with the RAND function

The first way I will show you is the easiest way to generate random values in Excel.

There is a very simple RAND function that requires no parameters and will generate a random number between 0 and 1.

Syntax for the RAND Function

random number generator 6 digits excel

This function has no required or optional arguments. The function is always entered with an empty set of parenthesis.

This function will generate a decimal random number between 0 and 1, but not including 0 or 1.

Repeated values are possible but unlikely since the RAND function produces numbers from a continuous range of numbers.

The values that are returned will follow a uniform distribution. This means that any number between 0 and 1 is equally likely to be returned.

Generate Random Numbers Between Any Two Numbers

A decimal number between 0 and 1 may not be too useful if you need numbers between 1 and 10.

But you can use a simple formula involving the RAND function to generate random numbers between any two numbers.

In general, you can create a random number between X and Y by using the above formula.

random number generator 6 digits excel

For example, to generate numbers between 1 and 10 you can use the above formula.

This multiplies the random number generated by 9 and then adds 1 to it. This will produce decimal numbers between 1 and 10.

Generate Random Integer Numbers Between Any Two Numbers

Another possible need you may encounter is to generate random whole numbers between two given numbers. This can also be done using a simple formula.

In general, you can use the above formula to generate random integer numbers between two values X and Y.

random number generator 6 digits excel

For example, the above formula will create random integer numbers between 1 and 10.

This is the same formula as before, but using the ROUND function to round to zero decimal places.

You can copy this formula down the column on the spreadsheet, and if you keep pressing F9 to re-calculate, you will see various combinations of numbers from 1 to 10.

Since the set of possible numbers is discrete, the random numbers generated may well be duplicated in the list, depending on what the minimum and maximum are of the range.

random number generator 6 digits excel

This also works for producing negative numbers. Suppose you need to generate random integer numbers between -3 and 4, then the above formula will be what you need.

Multiplying the RAND function by 7 will produce random numbers between 0 and 7. Add -3 to the result and round to zero decimal places, and this will give the range of random numbers of -3 to 4.

Generate Random Numbers using the RANDBETWEEN Function

Excel has a useful function for generating random numbers within a range of an upper and lower number.

This is easier to use than using the RAND function as it includes extra operators to arrive at your specific range.

Syntax for the RANDBETWEEN Function

  • bottom is the lower range for the values to return.
  • top is the upper range for the values to return.

Both of these arguments are required.

This function will produce random integer numbers between the bottom and top values. This function will also return the upper and lower limits as possible values as it’s not strictly between in this function.

Example with the RANDBETWEEN Function

random number generator 6 digits excel

For example, if you wanted random numbers between -3 and 4, as in the previous example, you can use the above formula.

Note that the RANDBETWEEN function can only produce integer numbers. There is no way of making the function produce decimal numbers. However, it is considerably less complicated than using the RAND function with operators to achieve the same result.

Generate Random Numbers with the RANDARRAY Function

Usually, it’s the case that you don’t want just a single random value but an entire set of random values.

The RANDARRAY function is the perfect solution for this.

It will populate a range of cells with an array of random numbers, which can be very powerful.

This function is only available on the Microsoft 365 version of Excel.

Syntax for the RANDARRAY Function

  • Rows is the number of rows to return.
  • Columns  is the number of columns to return.
  • Min  is the minimum value for the random numbers.
  • Max is the maximum value for the random numbers.
  • Whole_Number is TRUE to return whole numbers, and FALSE to return decimal numbers.

All the arguments are optional for this function.

If no parameters are included, you will get a single random number with decimal places, in the same way as the RAND function.

Example with the RANDARRAY Function

random number generator 6 digits excel

To generate an array of 4 rows and 3 columns of whole random numbers between 6 and 14 you can use the above formula.

This will produce an array of values. Notice the blue border around the numbers? These are all produced from a single formula!

Note that the top left-hand corner of the array is always anchored on the cell that the formula is in. Pressing F9 to recalculate the spreadsheet will change all the numbers in the array.

If you do not put a minimum or maximum value, the default of 0 to 1 will be used.

The minimum value must be less than the maximum value otherwise there will be a #VALUE! error.

The array will automatically resize if you change either the rows or columns parameters in the RANDARRAY formula. This is why they’re known as dynamic arrays.

Warning : If there is already data in one of the cells in the output range that you have entered, you will get a #SPILL! error.  No data will be overwritten.

Generate Random Numbers with the Analysis Tools Add-In

There is another method that can be used to insert random numbers without using a formula.

You can use an add-in to create random numbers. Excel comes with an Analysis Tool Pak add-in, but you will need to install it before you can use it.

Install the Analysis Toolpak

random number generator 6 digits excel

Here are the steps to install the Analysis Tool Pak add-in.

  • Click on the File tab in the ribbon.

random number generator 6 digits excel

  • In the lower left-hand pane of the window, scroll down and click on Options . You can also use the keyboard shortcut Alt , F , T from the spreadsheet window to open the Options window.

random number generator 6 digits excel

  • In the left-hand pane of the pop-up window, click on Add-Ins.
  • At the bottom of the main window displayed, select Excel Add-ins from the dropdown and click on the Go button.

random number generator 6 digits excel

  • This will display a pop-up window containing all available add-ins for Excel. Check the box for Analysis ToolPak and then click OK .

random number generator 6 digits excel

  • On the Excel ribbon, on the Data tab, there is now an extra group called Analysis with one button called Data Analysis .

Generate Random Numbers with the Analysis Toolpak

random number generator 6 digits excel

Click on the Data Analysis button in the Analysis group.

This will display a pop-up window. Scroll down and select the Random Number Generation option and then click OK .

random number generator 6 digits excel

A new pop-up window will appear where you can enter your parameters to generate the random numbers.

There are several settings that can be customized.

  • Number of Variables This is the number of columns of random numbers that you want in your output table. If left blank, then all columns will be filled in the output range that you specify.
  • Number of Random Numbers This is the number of rows of random numbers that you want to generate. If left blank, the output range that you specify will be filled.
  • Distribution  You can select several distribution methods from the drop-down such as uniform or normal distribution. Different options will become available in the Parameters section depending on your selection here.
  • Parameters  Enter the values to characterize the distribution selected.
  • Random Seed This is optional and will be the starting point for the algorithm to produce the random numbers. If you use the same seed again, it will produce the same random numbers. If left blank, it will take the seed value from the timer event.
  • Output Range Enter the upper left cell of where the table is to be constructed in the spreadsheet. If you have left the Variables parameter blank, then you will need to specify an entire range. Note that existing data in that range will be overwritten.
  • New Worksheet Ply This option will insert a new worksheet within the workbook and will paste the results at Cell A1. Enter a sheet name in the adjacent box, otherwise, a default name will be used.
  • New Workbook This will create a new workbook and paste the results into cell A1 in the first sheet.

random number generator 6 digits excel

Press the OK button and Excel will insert the random number according to the selected options.

Notice that unlike the formula methods previously shown, these numbers are hardcoded and will not change when you refresh calculations in the workbook.

Generate Random Numbers with VBA

VBA (Visual Basic for Applications) is the programming language that sits behind the front end of Excel, and this can also be used to generate random numbers.

However, it is more complicated than simply entering a formula into a cell in Excel, and you do need some programming knowledge to use it.

random number generator 6 digits excel

To open the VBA editor, use the Alt + F11 keyboard shortcut.

In the left-hand pane of the window (Project Explorer), you will see the workbooks that are open (including add-ins) and the sheets available.

On the menu at the top of the window, click on Insert and then click on Module . This will add a module window to the current spreadsheet. Paste or add the following code to the module.

random number generator 6 digits excel

Press F5 to run this, and a message pop-up will appear in Excel with a random number displayed. Press OK and you will return to the code window.

Run the code again and a different random number will be displayed. The random number will be between 0 and 1, but will not include the values of 0 or 1.

You can also give the Rnd function a parameter, which is a seed for the starting point of the algorithm to produce the random numbers.

If the seed value is set to a negative number or zero, then the same random number will be displayed each time.

Using VBA functions, you can emulate all the functionality of the front-end methods that have been covered in this article.

For example, if you wanted to generate whole random numbers between 3 and 10, then you would use the following above code.

This code multiplies the random number, by 7, and then adds 3 to it, and then rounds to zero decimal places.

Suppose that you then wanted to display your random numbers in the grid. You can do this with the following code.

random number generator 6 digits excel

This code uses a For Next loop to iterate 5 times through the random number calculation and enter the results in a column of cells starting at cell A1.

Remember that any data already there will be overwritten, and there is no warning or undo feature available. Save any previous work beforehand!

There is also a VBA function called Randomize . You can use this before the Rnd function to reset the seed value to the timer event, or to any parameter given.

Generate Random Numbers without Duplicates or Repeats

You may well have a situation where you want to generate a range of random numbers, but you do not want to see any duplicate values appearing.

You may want to select 3 random numbers between the numbers from 1 to 10, but where each of the 3 selected numbers is unique.

You could generate random numbers with the RANDBETWEEN function and then use the Excel function Remove Duplicates from the ribbon, but this still may not give you all the numbers required.

There are several possible solutions available.

Solution with RANK.EQ and COUNTIF Functions

If you don’t have access to the RANDARRAY function in Excel, then you can use a combination of RANK.EQ and COUNTIF to get unique random numbers.

You can create your random numbers using RANDBETWEEN and then use a formula in the next column to rank them thereby giving you a randomly sorted sequence from 1 to 10.

random number generator 6 digits excel

In cell B2, enter the above formula . Copy this formula down so that there are 10 rows of random numbers going down to cell B11.

You will notice that some numbers may be duplicated and some are not shown at all.

You can then use the RANK.EQ function to rank them so as to create a sequence from 1 to 10 but that is sorted randomly.

random number generator 6 digits excel

In cell C2, enter the above formula.

Note that there are absolute references used (the $ signs) so that formula references stay fixed as you copy the formula down.

Copy this formula down to cell C11, and this will display all the numbers between 1 and 10, but in random order.

To explain this formula in more depth, it uses two functions RANK.EQ and COUNTIF .

  • Number is the number that we want to find the rank of in the array.
  • Ref is the array where we want to search for the number.
  • Order is optional and allows you to find the rank in either ascending or descending order. If its omitted then ascending order is used.

The RANK.EQ function returns the rank of a number within an array of numbers.

  • Range is the range that is being searched for instances of the criteria.
  • Criteria is the value to match within the range.

The COUNTIF function counts the number of cells based on a given criterion. In this case, it is counting how many times a given random number has appeared in the list.

For each random number the RANK.EQ function will determine its ranking position relative to the other random numbers. But if the random numbers contain duplicates, then they will create a tied ranking.

The COUNTIF function will compensate for any ties in the ranking and will add one to the rank for each time the random number has previously appeared.

This creates a unique ranking where ties don’t get the same rank.

Since this rank is based on a set of random numbers the result is the same as randomizing a list of numbers from 1 to 10.

Now, if you only want 5 non-repeating numbers, you only need to take the first 5 from the ranking list.

Solution with VBA

You could also use VBA to generate a string of random numbers from 1 to 10 without duplicates.

This code iterates through values from 1 to 5, generating a random number between 1 and 10 each time.

It tests the random number to check if it has already been generated. This is done by concatenating successful numbers into a string and then searching that string to see if the number has already been used.

If it has been found, then it uses the label Repeat to go back and re-generate a new number. This is again tested that it has not already been used. If it is a new number, then it is added to the sheet.

Solution with Dynamic Arrays

If you have dynamic arrays in Excel, then there is a single formula method to avoid repeating values.

Suppose you want to return 5 numbers from the sequence 1 to 10. You want each number selected to be unique.

This can be done using a combination of the SEQUENCE , SORTBY , RANDARRAY , and INDEX functions.

random number generator 6 digits excel

The above formula creates a sequence of numbers from 1 to 10.

It then sorts them in a random order using the SORTBY function and sorting on a column of random numbers generated by the RANDARRAY function. The effect is to sort the sequence in random order.

Now if you want to get 5 random and unique numbers you only need to take the first 5 numbers from the randomly sorted sequence.

This is exactly what the INDEX function does! This part of the formula will return the first 5 numbers from the randomly sorted sequence.

There are several ways to generate random numbers in Excel.

Whether you need whole numbers, decimals, or a range of random numbers with an upper and lower limit, the facility is available. Excel is extremely versatile on this topic.

However, bear in mind that these numbers are pseudo-random numbers generated by an algorithm.

Although the random number generator passes all the tests of randomness, they are not true random numbers.

To be a truly random number, it would have to be driven by a random event happening outside the computer environment.

For most purposes of constructing general simulations and statistical analysis, the Excel random number generator is considered fit for the purpose.

Have you used any of these methods for generating random numbers in Excel? Do you know any other methods? Let me know in the comments below!

About the Author

John MacDougall

John MacDougall

Subscribe for awesome Microsoft Excel videos 😃

random number generator 6 digits excel

I’m John , and my goal is to help you Excel!

You’ll find a ton of awesome tips , tricks , tutorials , and templates here to help you save time and effort in your work.

  • Pivot Table Tips and Tricks You Need to Know
  • Everything You Need to Know About Excel Tables
  • The Complete Guide to Power Query
  • Introduction To Power Query M Code
  • The Complete List of Keyboard Shortcuts in Microsoft Excel
  • The Complete List of VBA Keyboard Shortcuts in Microsoft Excel

random number generator 6 digits excel

Related Posts

How to Find and Replace in Microsoft Excel

How to Find and Replace in Microsoft Excel

Mar 4, 2024

This effortless Microsoft Excel tutorial shall explain how to find and replace...

9 Ways to Remove Leading Zeros in Microsoft Excel

9 Ways to Remove Leading Zeros in Microsoft Excel

Do you want to learn how to remove leading zeros in Excel? This quick Excel...

7 Ways to Make Numbers Negative in Microsoft Excel

7 Ways to Make Numbers Negative in Microsoft Excel

This effortless Excel tutorial shall show you how to make numbers negative in...

Get the Latest Microsoft Excel Tips

random number generator 6 digits excel

Follow us to stay up to date with the latest in Microsoft Excel!

  • Kutools for Excel
  • Kutools for Outlook
  • Kutools for Word
  • Setup Made Simple
  • End User License Agreement
  • Get 4 Software Bundle
  • 60-Day Refund
  • Tips & Tricks for Excel (3000+)
  • Tips & Tricks for Outlook (1200+)
  • Tips & Tricks for Word (300+)
  • Excel Functions (498)
  • Excel Formulas (350)
  • Excel Charts
  • Outlook Tutorials
  • About Us Our Team

Feature Tutorials

  • Search Search more
  • Retrieve License Lost License?
  • Report a Bug Bug Report
  • Forum Post in Forum

Generate random number with the given specific length in Excel

Today, we may use multiple passwords in our daily work, and the password may be in different length. If you are tired to set a password, you can use formulas or a handy tool to generate random passwords for you. Here this tutorial provides some tricks to generate random numbers in your desired length in Excel.

Random number in a given specific length with using formula

Random number or other characters in a given length with using a handy tool, sample file.

Random number in a fixed length

Supposing you want to generate a random number string in 6-digit length, you can use this formula

Press Enter key, then then a random number in 6-digit length is outputted.

doc random number in specific length 1

Random number in a changed length based on the digit number you type in another cell

In some times, you may need to generate passwords in different lengths, for instance, when you type 5 in cell A1, the cell A2 will display a random number in 5-dighit length, if you type 9 in cell A1, the A2 displays a 9-digit number.

Select A2, the type this formula

doc random number in specific length 2

From now on, when you type a number in A1 and press Enter key, it generates a random number in the specific length in cell A2 based on the number you typed in cell A1.

If you not only want random number string in length, but also want random decimal number or integer number in a number range, or random text strings, or random date or time or custom list, you can try a handy tool, the Insert Random Data utility of Kutools for Excel .

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

doc random number in specific length 3

In the Insert Random Data dialog, choose the data type you want to generate from the tabs, then specify the data scope or settings as you need.

doc random number in specific length 4

Click to download sample file

Other Operations (Articles)

Generate random number by given certain mean and standard deviation in Excel In some certain cases, you may want to generate a series of random numbers based on given specific mean and standard deviation, how could you quickly solve this problem? Now this tutorial will introduce a way for you to handle with it in Excel.

Generate random character strings in a range in Excel Sometimes you may need to generate random strings in cells, such as different passwords. This article tries to show you some tricks to generate different random strings in Excel.

Generate only random even or odd numbers in Excel In this tutorial, I will introduce some formulas to help you generate only random even numbers or only random odd numbers in Excel.

Generate random date between two dates quickly in Excel When you use an Excel file, sometimes you want to generate random date for some purpose, of course, you can enter the date manually one by one, but if you need to insert multiple dates, this method will be time-consuming and boring. How to quickly generate random date on earth in Excel?

More articles

Excel Productivity Tools

The best office productivity tools, kutools for excel solves most of your problems, and increases your productivity by 80%.

  • 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 and Keeping Data; Split Cells Content; Combine Duplicate Rows and Sum/Average ... 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...
  • Favorite and Quickly Insert Formulas , Ranges, Charts and Pictures; Encrypt Cells with password; Create Mailing List and send emails...
  • 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 ...
  • Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name ...

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!

random number generator 6 digits excel

random number generator 6 digits excel

RAND function

This article describes the formula syntax and usage of the RAND  function in Microsoft Excel.

Description

RAND returns an evenly distributed random real number greater than or equal to 0 and less than 1. A new random real number is returned every time the worksheet is calculated.

The RAND function syntax has no arguments.

To generate a random real number between a and b, use:

=RAND()*(b-a)+a

If you want to use RAND to generate a random number but don't want the numbers to change every time the cell is calculated, you can enter =RAND() in the formula bar, and then press F9 to change the formula to a random number. The formula will calculate and leave you with just a value.

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2 , and then press Enter . You can adjust the column widths to see all the data, if needed.

Need more help?

You can always ask an expert in the Excel Tech Community  or get support in  Communities .

Mersenne Twister algorithm

RANDBETWEEN function

Facebook

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

random number generator 6 digits excel

Microsoft 365 subscription benefits

random number generator 6 digits excel

Microsoft 365 training

random number generator 6 digits excel

Microsoft security

random number generator 6 digits excel

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

random number generator 6 digits excel

Ask the Microsoft Community

random number generator 6 digits excel

Microsoft Tech Community

random number generator 6 digits excel

Windows Insiders

Microsoft 365 Insiders

Was this information helpful?

Thank you for your feedback.

How-To Geek

How to generate random numbers in microsoft excel.

Use a simple function, or get more advanced control with a generator tool.

Quick Links

Use the random number generator in excel, use the random number functions in excel.

If you need to generate one or more random numbers for business, education, or another purpose, you can do so right in Microsoft Excel. You can get random numbers  using either a random number generator tool or an Excel function.

Related: How to Generate Random Numbers in Google Sheets

With an add-in from Microsoft called Analysis ToolPak , you can perform many statistical and engineering operations such as finding a moving average . Another feature of the tool is a random number generator.

Add the Analysis ToolPak

To see if you already have the add-in, go to the Data tab and the Analysis section of the ribbon. Look for the Data Analysis button. If you have the button, you can skip down to using the tool.

If you don't see the button, you can add it easily. Go to File > Options and select "Add-ins" on the left. At the bottom of the window, go to Manage and pick "Excel Add-ins." Click "Go."

When the Add-ins window opens, check the box next to Analysis ToolPak and click "OK."

Use the Random Number Generator

Head to the Data tab and click "Data Analysis" in the Analysis section of the ribbon. When the window appears, select "Random Number Generation" and click "OK."

Starting at the top of the window, enter the number of columns you want to fill using the Number of Variables box. Then, enter the number of rows in the Number of Random Numbers box.

This generator is advanced in that you can select the distribution you want to use from options like Bernoulli, Binomial, Patterned, and Discrete. Once you select the Distribution from the drop-down list, the Parameters section will update with the necessary information for you to complete.

In the Random Seed field, you can enter a starting number (up to 9999) for the generator to use if you like. Then, choose one of the Output Options for where you want your random numbers to display.

Click "OK" when you're ready and you'll receive your numbers.

Another option for generating random numbers in Excel is using a function. There are three functions you can use . Each time you recalculate or reopen the workbook, a new random number will be generated with these functions. They don't offer as many options as the Random Number Generator tool, but they're simpler to use.

Related: How to Find the Function You Need in Microsoft Excel

The RAND Function

function, you can generate a random number greater than or equal to zero and less than one. This provides you with decimal number options. But you can also get numbers going higher than one by tweaking the formula.

For a basic random number, enter the following and press Enter:

For a random number greater than or equal to zero and less than 500, enter the following and hit Enter:

=RAND()*500

For a random whole number greater than or equal to zero and less than 500, enter the following and press Enter:

=INT(RAND()*500)

The RANDBETWEEN Function

Maybe you want to generate a number that's between two specific numbers. In this case, you'd use the RANDBETWEEN  function .

For a random number between 10 and 100, enter the following and press Enter:

=RANDBETWEEN(10,100)

For a random number between negative 10 and 10, enter the following and hit Enter:

=RANDBETWEEN(-10,10)

Related: How to Create Random (Fake) Datasets in Microsoft Excel

The RANDARRAY Function

For Microsoft 365 subscribers, the RANDARRAY function provides a set of random numbers. You can choose the number of rows and columns to fill with numbers. You can also select minimum and maximum values and specify whole numbers or decimals.

The syntax for this function is RANDARRAY(rows, columns, minimum, maximum, whole-decimal) where you enter True for a whole number or False for a decimal number as the last argument. All arguments are optional.

For a random array of numbers that cover three rows and four columns, you'd enter the following and hit Enter:

=RANDARRAY(3,4)

For a random array that covers the same number of rows and columns but also has a minimum of 1 and a maximum of 10, enter the following and press Enter:

=RANDARRAY(3,4,1,10)

For a random array using these same arguments but returns only whole numbers, you would enter the following and press Enter:

=RANDARRAY(3,4,1,10,TRUE)

Microsoft Excel gives you easy options for generating random numbers . Whether you need a discrete number or simply a number between one and 10, Excel has you covered.

How to Generate Random Numbers in Excel

There may be cases when you need to generate random numbers in Excel.

For example, to select random winners from a list or to get a random list of numbers for data analysis or to create random groups of students in class.

In this tutorial, you will learn how to generate random numbers in Excel (with and without repetitions).

Generate Random Numbers in Excel

There are two worksheet functions that are meant to generate random numbers in Excel: RAND and RANDBETWEEN.

  • RANDBETWEEN function would give you the random numbers, but there is a high possibility of repeats in the result.
  • RAND function is more likely to give you a result without repetitions. However, it only gives random numbers between 0 and 1. It can be used with RANK to generate unique random numbers in Excel (as shown later in this tutorial).

Generate Random Numbers using RANDBETWEEN function in Excel

Excel RANDBETWEEN function generates a set of integer random numbers between the two specified numbers.

RANDBETWEEN function takes two arguments – the Bottom value and the top value. It will give you an integer number between the two specified numbers only.

For example, suppose I want to generate 10 random numbers between 1 and 100.

Here are the steps to generate random numbers using RANDBETWEEN:

  • Select the cell in which you want to get the random numbers.
  • In the active cell, enter =RANDBETWEEN(1,100).
  • Hold the Control key and Press Enter.

This will instantly give me 10 random numbers in the selected cells.

While RANDBETWEEN makes it easy to get integers between the specified numbers, there is a high chance of repetition in the result.

For example, when I use the RANDBETWEEN function to get 10 random numbers and use the formula =RANDBETWEEN(1,10), it gives me a couple of duplicates.

If you’re OK with duplicates, RANDBETWEEN is the easiest way to generate random numbers in Excel.

Note that RANDBETWEEN is a volatile function and recalculates every time there is a change in the worksheet. To avoid getting the random numbers recalculate, again and again, convert the result of the formula to values .

Generate Unique Random Numbers using RAND and RANK function in Excel

I tested the RAND function multiple times and didn’t find duplicate values. But as a caution, I recommend you check for duplicate values when you use this function.

Suppose I want to generate 10 random numbers in Excel (without repeats).

Here are the steps to generate random numbers in Excel without repetition:

  • Select the cells in which you want to get the random numbers.
  • In the active cell, enter =RAND()
  • Select all the cell (where you have the result of the RAND function) and convert it to values .

Now you can use the values in column B as the random numbers.

Note: RAND is a volatile formula and would recalculate every time there is any change in the worksheet. Make sure you have converted all the RAND function results to values.

Caution: While I checked and didn’t find repetitions in the result of the RAND function, I still recommend you check once you have generated these numbers. You can use Conditional Formatting to highlight duplicates or use the Remove Duplicate option to get rid of it.

You May Also Like the Following Excel Tutorials:

  • Automatically Sort Data in Alphabetical Order using Formula .
  • Random Group Generator Template
  • How to Shuffle a List of Items/Names in Excel?
  • How to Do Factorial (!) in Excel (FACT function)

FREE EXCEL BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

3 thoughts on “How to Generate Random Numbers in Excel”

The link or the Ebooks do not send to my email

Just a trick, RAND and RANDBETWEEN are volatile functions, so each time there’s a change they will be updated. To avoid this, you can create a Pivot Table referencing the cells with the random values (functions) and then reference the Pivot Table values. This way the random values won’t change until the Pivot Table is updated.

Leave a Comment Cancel reply

BEST EXCEL TUTORIALS

Best Excel Shortcuts

Conditional Formatting

Excel Skills

Creating a Pivot Table

Excel Tables

INDEX- MATCH Combo

Creating a Drop Down List

Recording a Macro

© TrumpExcel.com – Free Online Excel Training

Privacy Policy  | Sitemap

Twitter | Facebook | YouTube | Pinterest | Linkedin

FREE EXCEL E-BOOK

ExcelTutorial

3 Easy Ways to Generate Random Numbers In Excel

random number generator 6 digits excel

In this tutorial, we will demonstrate how to easily generate random numbers in Excel. In three easy ways, you can use the RAND() function to generate random numbers with different parameters and customize how many numbers you want to generate.

Step-by-step Guide to Generate Random Numbers In Excel

Using rand().

  • Start by inputting the formula =RAND() in the cell.
  • Press ENTER and it will immediately show a random number.
  • Drag down the formula to increase the range that you want.

random number generator 6 digits excel

To ensure that the random numbers in the cells don’t change:

  • Copy the cells
  • On the first cell, press RIGHT CLICK
  • Select PASTE OPTION , choose VALUES

This will delete the original formula and retain the values you copied.

random number generator 6 digits excel

Producing random decimal numbers in the hundreds. In the above example, RAND() always generates decimal numbers from 0 to 1, but you can modify this by changing the formula. To do this, add *100 to the formula to produce random numbers in the hundreds .

random number generator 6 digits excel

Generating random decimal numbers in between the bottom and top values. In the same example, we want to generate decimal numbers in between the bottom and top values. If you have 10000 as the bottom value and 20000 as the top value, you modify the formula by changing it to =10000+10000*RAND() (the top value should be the difference of the two values).

random number generator 6 digits excel

Producing random decimal numbers between 50 and 80. To do this, change the formula to =50+30*RAND() (the difference between 50 and 80 is 30, so this will serve as the top value) and press ENTER.

random number generator 6 digits excel

USING RANDBETWEEN

  • Input the formula =RANDBETWEEN( in the cell.
  • To generate random numbers between a set of parameters, input the bottom number as the lowest value and the top number as the highest value (For example, =RANDBETWEEN(10000, 20000) will generate random numbers between 10000 and 20000).
  • Close the formula with a ) .

random number generator 6 digits excel

USING RANDARRAY

  • Select the range of cells where you want to display the random numbers.
  • Type =RANDARRAY in the formula bar
  • Enter the number of rows and columns you want.
  • Specify the minimum and maximum value of each number in the array.
  • Choose between INTEGERS (TRUE) or DECIMALS (FALSE) in the array.
  • Press ENTER .

random number generator 6 digits excel

Generating random numbers in Excel is an easy and convenient process. With the use of the RAND(), RANDBETWEEN, and RANDARRAY functions, you can quickly generate random numbers with specific parameters and manipulate them as needed. Excel offers a straightforward way to generate and view random numbers, making it an optimal choice for those needing to create random numbers.

Related Posts:

lookup-overview

How to Generate Random Numbers in Excel: RAND & RANDBETWEEN

Randomness in numbers means a set of numbers that simply lacks a pattern.

Random numbers have a great application in practical life. Starting from the field of auditing (to pick random samples), to statistics, to sciences, and so on 👩‍🏫

Psychologically speaking, a human brain can never pick truly random numbers. We are always biased.

And that is where we need machines to intervene. Excel has a variety of functions to generate random numbers. Two of them are the RAND and RANDBETWEEN functions.

To learn all about these functions – glide right into the guide below.

Table of Contents

Random numbers with RAND

Random numbers with randbetween, frequently asked questions.

RAND is the most basic function to generate unique random numbers in Excel. The easiest and the simplest.

To talk about the arguments of this function, it does not argue. In other words, it has no argument 💁‍♀️ Funny, no?

The RAND function of Excel generates random decimal numbers that fall between 0 and 1.

The RAND function is available in all versions of Excel. Starting from Excel 2000 to Excel 365.

To find a random number in Excel (and it could be any random number ranging from 0 to 1), write the RAND function as follows:

Hit “Enter” and that’s it.

You get a random number. That’s how easy it is to create random numbers in Excel 🤩

If you want to generate a series of random numbers, copy this formula and paste it into multiple cells.

Or drag and drop it to as many cells (on the bottom, or the right) as many random numbers are needed 📍

Here, we have copied this formula to 4 cells on the bottom.

And there we have 4 random numbers generated in Excel.

The RANDBETWEEN is a very cool function of Excel. It generates a random number (or a series of random numbers) within a specified range 😎

However, note that the RANDBETWEEN function only generates random integers. Not decimal numbers.

The RANDBETWEEN function is only available in Excel 2007 version and onwards.

To generate a random number in Excel between 0 and 100:

  • Select the cell where you want the random number populated.
  • Write the RANDBETWEEN function as follows:

= RANDBETWEEN (0,100)

In the above function, 0 is the bottom and 100 is the top.

This tells Excel to generate a random number that falls between 0 to 100. In other words, an integer that is equal to or greater than 0 but smaller or equal to 100 ✌

  • Hit “Enter” and there you go.

That’s how you can create random integer numbers in excel.

Need more of them?

4. Drag and drop the cell down across as many cells as many values are needed.

For example, we want 4 more such random numbers so dragging it 4 cells down⬇

Similarly, you can drag this list to the right or left of your cells to generate as many random numbers, as needed.

For example, here we have dragged it 4 columns to the right ➡

The random number functions of Excel are volatile 🔥

They recalculate every time any action is performed on your spreadsheet. This action needs not to be something about the random number functions. It could be anything.

For example, if you applied the RAND function and got a random number 81. If the sheet is recalculated, the RAND function will recalculate and return another random number. Say 97.

Here’s how you can stop these functions from recalculating over and over again 🚴‍♀️

  • Click on the cell where the function is written. Go to the formula bar and press the F9 key . This converts the function into its value. This means 81 is now a general value in Excel. It won’t change with new recalculations now.
  • If you have many random numbers in your Excel sheet, copy them. And paste them as values using Past Special > Values .

That’s it – Now what?

The guide above teaches different ways of generating random numbers in Excel. You can generate single or multiple random decimal numbers using the RAND function 🔢

And with the RANDBETWEEN function, you can land on a random integer between a specified minimum and maximum limit. How cool is that?

If you enjoyed learning about these functions in Excel, let me tell you there’s so much more to learn about Excel.

Excel’s function library is a very vast one. To begin learning, I recommend you go with the VLOOKUP, SUMIF, and IF functions of Excel.

How? Enroll in my 30-minute free email course here that teaches you all about these functions.

Other resources

In addition to generating random numbers in Excel, you might simply want to randomize an already created list in Excel.

Or you may want or sort a randomized list in Excel. Well, for both of the said cases, we have got you covered.

Read our other blogs to learn how to do that in Excel.

How do I generate multiple random numbers in Excel?

To generate multiple random numbers in Excel, apply the =RAND() function in any cell of Excel.

Copy and paste or drag and drop this formula to multiple cells to get multiple random numbers in Excel.

How do I generate a random number between 1 to 100 in Excel?

Use the RANDBETWEEN function to generate a random number in Excel between any two given numbers.

For random numbers between 1 to 100, write the RANDBETWEEN function as follows:

Excel will return any random number between 0 and 100.

#1 Excel tutorial on the net

  • Random Numbers

Rand   |  RandBetween   |  RandArray   |  Random Number Generator

Excel has two very useful functions when it comes to generating random numbers . RAND and RANDBETWEEN .

The RAND function generates a random decimal number between 0 and 1.

1. Select cell A1.

2. Type =RAND() and press Enter. The RAND function takes no arguments.

RAND function

3. To generate a list of random numbers, select cell A1, click on the lower right corner of cell A1 and drag it down.

List of Random Numbers

Note that cell A1 has changed. That is because random numbers change every time a cell on the sheet is calculated.

4. If you want random numbers that remain constant once generated, simply copy the random numbers and paste them as values.

Paste As Values

5. Select cell C1 and look at the formula bar. This cell holds a value now and not the RAND function.

Values

RandBetween

The RANDBETWEEN function generates a random whole number between two boundaries.

2. Type =RANDBETWEEN(50,75) and press Enter.

RANDBETWEEN function

3. If you want to generate random decimal numbers between 50 and 75, modify the RAND function as follows:

Modified RAND function

If you have Excel 365 or Excel 2021, you can use the magic RANDARRAY function.

1. By default, the RANDARRAY function generates random decimal numbers between 0 and 1. The array below consists of 5 rows and 2 columns.

RANDARRAY function

Note: this dynamic array function, entered into cell A1, fills multiple cells. Wow! This behavior in Excel 365/2021 is called spilling .

2. The RANDARRAY function below generates an array of decimal numbers, 1 row by 5 columns, between 99 and 100.

Generate Random Decimal Numbers

3. The RANDARRAY function below generates an array of integers, 10 rows by 1 column, between 20 and 80.

Generate Random Integers

Note: the Boolean TRUE (fifth argument) tells the RANDARRAY function to return an array of integers.

Random Number Generator

To create a random number generator in Excel , simply press F9 or use VBA (our favorite).

2. Type =RANDBETWEEN(0,100) and press Enter.

3. Select cell A1, click on the lower right corner of cell A1 and drag it down to cell A10.

Random Numbers Between 0 and 100

4. Press F9 to generate new random numbers repeatedly.

Random Number Generator in Excel

5. To generate random numbers with no duplicates, combine UNIQUE with RANDARRAY.

Generate Random Numbers with No Duplicates

Note: press F9 to refresh the random numbers. Sometimes you will see an array that consists of fewer than 10 numbers (when the RANDARRAY function generates duplicates).

You can also use VBA to create a random number generator in Excel. This approach enables you to quickly produce random numbers that remain constant once generated.

1. Select a range of any size! (for example, the range A1:D10).

2. Execute the following code lines:

Random Number Generator (VBA)

Note: if you're new to VBA, we're here to help you create and execute a macro .

  • Statistical Functions

Learn more, it's easy

  • Negative Numbers to Zero
  • Percentiles and Quartiles
  • Box and Whisker Plot
  • MaxIfs and MinIfs
  • Weighted Average
  • Standard Deviation

Download Excel File

  • random-numbers.xlsx

Next Chapter

Follow excel easy.

Excel Easy on Facebook

Become an Excel Pro

  • 300 Examples

Random Numbers • © 2010-2024 Popular Excel Topics: Pivot Tables • Vlookup • Formulas • Charts • Conditional Formatting

Spreadsheet Planet

How to Generate Random Numbers in Excel (Without Duplicates)

Randomness is often just as necessary as order and symmetry, whether you are dealing with life or an Excel worksheet. Sometimes, you need it to ensure every value has an equal opportunity, like in a lottery.

The concept of ‘chance’ also plays an important role in simulating complex systems. It helps you test data. We often use random numbers to generate sample datasets for our tutorials too!

The good news is, Excel contains some very useful functions to help generate random numbers. The bad news is that these functions don’t always promise a unique set of random numbers.

If you look up ‘ How to Generate Random Numbers without Duplicates in Excel ’, you’ll probably find at least 10 different ways to do it.

Most of them work quite well too. However, we’ve noticed most tutorials leave you with a really long formula and hardly any explanation on how it works.

In this tutorial, we will show you 2 different ways in which you can generate unique random numbers in Excel using formulas.

Table of Contents

Random Number Generating Functions in Excel

There are mainly 2 random number generating functions available in Excel. Let us see them one by one:

RANDBETWEEN Formula

The RANDBETWEEN function is a great function that helps you generate random whole numbers between an upper and lower limit.

The syntax for this function is:

In the above formula, you can specify the lower and the upper limit. For example, if the limits are 10 and 1000, this formula will generate random numbers between these two specified limits.

This method most likely produces unique results if you have a larger range and need to generate a small number of random numbers.

For example, if you need to generate 10 numbers in the range of 10 to 1000. However, this is not the most reliable method for getting unique random numbers.

RAND Formula

The RAND function returns a decimal random number between 0 and 1. It takes no arguments, so its syntax is just

The great thing about this function is that there is a good probability that the numbers generated by it will not repeat, at least for 100,000 times.

The main differences between RAND() and RANDBETWEEN() are :

  • RANDBETWEEN returns a whole number while RAND returns a decimal number
  • RANDBETWEEN needs two parameters that specify the range in which the random numbers will be generated. RAND does not take any parameters. It can generate any number between 0 and 1.
  • RANDBETWEEN is less likely than RAND to generate unique random numbers.

Both RANDBETWEEN and RAND recalculate values every time the worksheet gets updated.

That means you get a new random number every time you change any cell value in the worksheet or press the F9 key .

Both these numbers fail to provide truly random numbers if used on their own, but combining them with other functions, gives a high probability of getting random numbers without repetition. Let us see how.

Using RAND and RANK to get Random Numbers in Excel Without Duplicates

You can combine the RAND and RANK functions to get a set of random numbers without duplicates.

The RANK function returns the rank of a number within a set of numbers.

Its syntax is as follows:

The first parameter is the number or reference that you want to rank.

The second parameter is the set of numbers or range of cells that you will rank from.

The third parameter is optional. It specifies whether you want to rank in ascending or descending order. If it’s 0, the numbers are ranked in descending order. If otherwise the numbers are ranked in ascending order. By default, the numbers are ranked in descending order.

Let’s say you want 10 random numbers from A2 to A11. Here’s how you can combine the two functions:

Uisng the RAND function to generate random number

  • In the adjacent column (B), use the RANK formula as follows: =RANK(A2, $A$2:$A$11). The second parameter is a range of absolute cell locations. These make sure the cell references do not change when the formula is copied to other cells.
  • Press the Return Key.

Unique random numbers without duplicates

  • Now, these numbers are volatile at the moment, since the RAND() function always recalculates every time there’s a change in the worksheet. To avoid that, copy the cells (B2:B11) and paste them in the same place as value.
  • Delete the first column (A).

This should give you a list of 10 random numbers, and that too without any repetition.

All we did here is get a random set of decimal numbers between 0 and 1 and then rank these numbers from 1 to 10 to get unique random integers.

Thus, we got a nice random set of numbers between 1 and 10 in column B (before deleting Column A).

This method should give you completely random and unique numbers with 99% assurance. But there might be slight discrepancies if you have to generate a much larger set of numbers.

For this, you can use the Remove Duplicates option to get rid of any duplicates.

Select the range of cells containing your random set of numbers.

From the Data tab, select Remove Duplicates from the Data Tools group.

Remove duplicates

Using RAND, LARGE and MATCH to get Random Numbers in Excel Without Duplicates

A similar method is to use RAND in combination with LARGE and MATCH functions. The LARGE function returns the kth largest value in a list, for example, the fourth largest value or the fifth largest value, etc. The syntax for this function is

Here, the first parameter is the set of numbers or range of cells in which you want to find the largest

The second parameter is an integer that specifies the position from the largest value, i.e. the kth position.

The MATCH function looks for an item in a range of cells and then returns the relative position of that item. The syntax for this function is:

Here, the first parameter is the value you are looking for.

The second parameter is the set from which you want to find the value’s position

The third parameter is optional. It is basically used to specify the type of matching that should be done (the largest value that is less than, the smallest value that is greater than or exact match).

Let’s say you want 10 random numbers from A2 to A10. Here’s how you can combine the three functions:

  • In the first cell (A2), type: =RAND(). This will generate a random number between 0 and 1.
  • Pull down the fill handle (located at the bottom right corner of the cell) to copy the formula to as many cells as you need. So if you want 10 random numbers, copy it down to cell A11.
  • In the adjacent column (B), use the LARGE formula as follows: =LARGE($A$2:$A$11,ROW(A1)). The first parameter is a range of absolute cell locations. These make sure the cell references do not change when the formula is copied to other cells. Here, we are trying to find the 1st largest value from A2 to A11. ROW(A1) means the row number of A1, in other words, the number 1. This formula could also have been written as: =LARGE($A$2:$A$11,1). But since we want the value to change when it is copied in each row, we used ROW(A1) instead.
  • Press the Return Key
  • Drag down the fill handle for the cell (B2) or just double click it.
  • In the next column (C), use the MATCH function as follows: =MATCH(B2,$A$2:$A$11,0). Here, we are trying to find the position of the value in B2 in the range A2 to A11. We want an exact match, so we specify the third parameter as 0.
  • Drag down the fill handle for the cell (C2) or just double click it.
  • These numbers are volatile at the moment since the RAND() function always recalculates every time there’s a change in the worksheet. To avoid that, copy the cells (C2:C11) and paste them in the same place as value.
  • Delete the first two columns (A and B).

This should give you a list of 10 random numbers without any repetition.

In this method, we got a random set of decimal numbers between 0 and 1 in column A and then arranged them in descending order in column B.

Next, we found the position of each number from column B in the set of random numbers of column A. This gave us a random set of numbers between 1 and 10 in column C (before deleting Columns A and B).

All we did here was convert the random decimal numbers to their integer counterparts.

In this tutorial, we showed you two ways in which you can generate random numbers in Excel without repetition.

There are plenty of other ways to do this. We leave it up to you to decide which way you find the easiest and most effective.

Other Excel tutorials you may find useful:

  • How to Reverse a Text String in Excel (Using Formula & VBA)
  • How to Highlight Every Other Row in Excel
  • How to Format Phone Numbers in Excel
  • How to Generate Random Names in Excel
  • How to Convert Decimal to Fraction in Excel
  • Excel Showing Formula Instead of Result (How to FIX!)
  • Get Unique Values from a Column in Excel

' src=

Steve Scott

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.

Leave a Comment Cancel reply

Save my name, email, and website in this browser for the next time I comment.

How to Generate Random Numbers in Excel

Written by: Bill Whitman

Last updated: May 20, 2023

How to Generate Random Numbers in Excel

Are you looking for a quick and easy way to generate random numbers in Microsoft Excel? Look no further. As an expert in Microsoft Excel, I can provide you with a straightforward solution. Excel offers a variety of functions that can help you generate random numbers with ease, including the RAND function. In this blog post, I will walk you through the process of generating random numbers in Excel, including how to use the RAND function and how to apply it to your specific needs. Let’s get started!

Understanding Randomness in Excel

Before diving into generating random numbers in Excel, it’s important to understand what “random” means in this context. In Excel, randomness refers to the chance that any number within a range could be selected. Excel offers a variety of functions that provide different types of randomness, such as uniform distribution, normal distribution, and more. For the purpose of this tutorial, we will focus on generating random numbers using the RAND function.

Using the RAND Function

The easiest way to generate random numbers in Excel is by using the RAND function. The RAND function generates a random decimal number between 0 and 1, with each value equally likely to be chosen. Here’s how to use the RAND function:

Step 1: Select a Cell

Start by selecting the cell where you want to generate the random number.

Step 2: Enter the RAND Function

Next, type “=RAND()” into the selected cell. Press enter, and a random decimal number between 0 and 1 will appear in the cell.

Step 3: Copy and Paste the RAND Function

To generate additional random numbers using the RAND function, simply copy and paste the function into additional cells. Each time the function is pasted into a new cell, a new random decimal number will be generated.

Generating Whole Numbers using the INT Function

If you need to generate whole numbers instead of decimals, you can use the INT function in conjunction with the RAND function. Here’s how to do it:

Step 2: Enter the INT Function

Type “=INT(RAND()*n)” into the selected cell, where “n” represents the highest number you want to generate. For example, if you want to generate random numbers between 1 and 10, you would enter “=INT(RAND()*10)+1”.

Step 3: Copy and Paste the Formula

As with the RAND function, you can copy and paste the formula into additional cells to generate more random whole numbers.

Generating random numbers in Excel doesn’t have to be difficult. With the RAND and INT functions, you can quickly generate random decimal or whole numbers for a variety of purposes. Try using these functions the next time you need to generate random numbers in Excel.

Using the RANDBETWEEN Function

If you’re looking for a quick way to generate random whole numbers within a specific range, you can use the RANDBETWEEN function. This function allows you to specify a range of whole numbers, and Excel will choose a random number within that range. Here’s how to use the RANDBETWEEN function:

Step 2: Enter the RANDBETWEEN Function

Type “=RANDBETWEEN(x,y)” into the selected cell, where “x” represents the lowest number in the range and “y” represents the highest number in the range. For example, if you want to generate a random number between 1 and 10, you would enter “=RANDBETWEEN(1,10)”.

As with the other functions, you can copy and paste the formula into additional cells to generate more random whole numbers in the same range.

Generating Random Dates and Times

In addition to generating random numbers, Excel can also generate random dates and times. This is a useful feature for creating mock data sets or testing formulas. Here’s how to generate random dates and times in Excel:

Start by selecting the cell where you want to generate the random date or time.

Step 2: Enter the RAND Function for Dates and Times

To generate a random date, enter “=RAND()*365+DATE(2000,1,1)” into the selected cell. This will generate a date between January 1, 2000 and December 31, 2000. To generate a random time, enter “=RAND()” into the selected cell. This will generate a decimal number between 0 and 1, which you can format as a time.

As with the other functions, you can copy and paste the formula into additional cells to generate more random dates or times.

Excel offers a wide range of functions for generating random numbers, dates, and times. By using the RAND, INT, and RANDBETWEEN functions, you can quickly and easily generate random data sets for a variety of purposes. Whether you’re working with large data sets or simply need a quick and easy way to generate random numbers, Excel has you covered.

Here are some frequently asked questions about generating random numbers in Excel:

Can I generate random numbers without decimals?

Yes, you can use the INT function in combination with the RAND function to generate whole numbers. Simply multiply the RAND function by the highest number you want to generate, and wrap the whole formula in the INT function. For example, to generate random whole numbers between 1 and 5, you could use the formula “=INT(RAND()*5)+1”.

What’s the difference between the RAND and RANDBETWEEN functions?

The RAND function generates a random decimal number between 0 and 1, while the RANDBETWEEN function generates a random whole number within a specified range. The RANDBETWEEN function is useful when you need to generate whole numbers within a specific range.

Can I generate random dates and times in Excel?

Yes, Excel offers several functions that allow you to generate random dates and times. The RAND function can be used to generate random decimal numbers, which you can then format as dates or times. The RANDBETWEEN function can also be used to generate random dates within a specific range.

Can I generate a list of unique random numbers in Excel?

Yes, you can use the RAND function in combination with the RANK function to generate a list of unique random numbers. First, enter the RAND function into each cell in a column. Then, use the RANK function to rank the values in the column as either ascending or descending. This will give you a list of unique random numbers.

Can I generate random numbers based on certain criteria?

Yes, you can use the IF function in combination with the RAND function to generate random numbers based on certain criteria. For example, if you wanted to generate random numbers between 1 and 10 only for cells that contain the text “Dog”, you could use the formula “=IF(A1=”Dog”,RAND()*10,””)”. This would generate a random number only for cells that contain the text “Dog”.

Other Categories

  • Basic Excel Operations
  • Excel Add-ins
  • Excel and Other Software
  • Excel Basics and General Knowledge
  • Excel Cell References and Ranges
  • Excel Charts and Graphs
  • Excel Data Analysis
  • Excel Data Manipulation and Transformation
  • Excel Data Validation and Conditional Formatting
  • Excel Date and Time Functions
  • Excel Errors
  • Excel File Management
  • Excel Formatting and Visual Adjustments
  • Excel Formulas and Functions
  • Excel Integration and Conversion
  • Excel Linking and Merging
  • Excel Macros and VBA
  • Excel Printing
  • Excel Settings
  • Excel Tips and Shortcuts
  • Excel Versions
  • Form Controls and User Interaction
  • Pivot Tables
  • Working with Text

How to Use Structured References in Excel

How to Use Structured References in Excel

How to Remove Drop-down in Excel

How to Remove Drop-down in Excel

How to Group Worksheets in Excel

How to Group Worksheets in Excel

How to Recover Excel File Not Saved

How to Recover Excel File Not Saved

How to remove subtotals in excel.

How to Unlock a Cell in Excel

How to Unlock a Cell in Excel

Featured posts.

Zebra BI logo

How to Generate Random Numbers in Excel

A spreadsheet with a column of randomly generated numbers

Random numbers play an important role in data analysis and decision-making. They are useful when designing experiments, conducting polls, and creating simulations. Random numbers can help to test the validity of a hypothesis or to generate a sample of data that represents a larger population. In Excel, there are many ways to generate random numbers, and this article will explore all of them in detail.

Table of Contents

Why is it Important to Generate Random Numbers in Excel?

Random numbers are necessary for creating unbiased experiments, and they can also be useful for creating statistically significant samples of data. Random numbers help to eliminate any systematic bias that may be present in the data, and they provide a means of measuring the effects of chance. With random number generation, we can create simulations that test the likely outcomes of experiments, and we can also create random samples of data that are representative of a larger population.

Another important reason for generating random numbers in Excel is for security purposes. Random numbers can be used to create strong passwords, encryption keys, and other security measures. By using random numbers, we can ensure that our security measures are not predictable or easily guessable, making them more effective in protecting sensitive information.

Furthermore, random numbers can also be used in gaming and gambling applications. Random number generation is essential for creating fair and unbiased games, such as slot machines or card games. By using random numbers, the outcome of the game is not predetermined, and each player has an equal chance of winning.

Understanding the Basics of Random Number Generation in Excel

Excel comes with two built-in functions for generating random numbers: RAND() and RANDBETWEEN(). The RAND() function creates a random decimal number between 0 and 1, while the RANDBETWEEN() function generates a random integer between two specified values. When combined with other functions, these built-in functions can be used to generate different types of random numbers.

It is important to note that the random numbers generated by Excel are not truly random, but rather pseudo-random. This means that the numbers are generated using a mathematical algorithm and a seed value, which can be manually set or left to the default value of the computer’s clock. As a result, the same seed value will always produce the same sequence of random numbers.

Random number generation in Excel can be useful in a variety of applications, such as simulating data for statistical analysis or generating unique IDs for database entries. However, it is important to use caution when relying on random numbers for critical applications, as the pseudo-random nature of Excel’s functions can potentially lead to biased or predictable results.

How to Generate Random Numbers Using the RAND Function in Excel

The RAND function creates a random decimal number between 0 and 1, which can be used to generate random numbers of any type. To generate a random decimal number, simply enter the following formula into a cell: =RAND(). Excel will generate a new random number every time the sheet is recalculated.

It is important to note that the RAND function is a volatile function, meaning that it will recalculate every time the sheet is recalculated, even if no changes have been made to the sheet. This can cause issues if you are using the RAND function in a large dataset or in a complex formula, as it can slow down the performance of your spreadsheet. To avoid this, you can copy and paste the values of the random numbers into a new column or sheet, which will remove the volatility of the function and improve the performance of your spreadsheet.

How to Generate Random Decimal Numbers in Excel

If you need to generate random decimal numbers within a specific range, you can use the following formula: = (RAND()*(b-a))+a, where a is the lower limit and b is the upper limit. For example, to generate a random decimal number between 10 and 20, use the formula: = (RAND()*(20-10))+10.

It is important to note that the RAND function in Excel generates a random decimal number between 0 and 1. Therefore, to generate a random decimal number within a specific range, you need to multiply the result of the RAND function by the range and then add the lower limit.

Another useful function for generating random numbers in Excel is the RANDBETWEEN function. This function allows you to generate random integers within a specific range. To generate a random integer between 1 and 100, for example, use the formula: =RANDBETWEEN(1,100).

How to Generate Unique Random Numbers in Excel

To generate a list of unique random numbers in Excel, you can use the following approach. First, use the RAND function to generate a random number for each row in a column. Then, to prevent duplicates, you can use the Remove Duplicates feature found under the Data tab. This will ensure that each number in your list is unique. Remember to convert the random numbers from formulas to values before using the Remove Duplicates feature to prevent the numbers from changing.

Another method is to use a combination of the RANDBETWEEN function and a helper column to track which numbers have already been used. You can then create a loop using VBA to generate a new number if a duplicate is found. This method requires some knowledge of VBA and is more complex but can be effective for larger datasets.

Tips for Generating High-Quality Random Numbers in Excel

To generate high-quality random numbers in Excel, it is important to avoid certain common mistakes. First, be sure to use the RAND and RANDBETWEEN functions correctly – for example, using RANDBETWEEN with non-integer values will lead to errors. Second, always use a large enough sample size to ensure that the randomness is not compromised by patterns or biases in the data. Finally, consider using macros for more advanced random number generation.

Another important factor to consider when generating random numbers in Excel is the seed value. The seed value is a starting point for the random number generator and can greatly affect the randomness of the generated numbers. It is recommended to use a unique seed value for each set of random numbers to ensure maximum randomness. Additionally, it is important to avoid using predictable seed values, such as dates or times, as this can lead to patterns in the generated numbers.

How to Use the RANDBETWEEN Function for Range-Based Random Number Generation

The RANDBETWEEN function generates a random integer between two specified values. For example, to generate a random integer between 1 and 10, use the formula: =RANDBETWEEN(1,10). This function is useful for generating random numbers within a specific range.

It is important to note that the RANDBETWEEN function recalculates every time the worksheet is opened or changed. This means that if you want to keep the same random number, you should copy and paste the value as a static number.

Additionally, the RANDBETWEEN function can be used in combination with other functions to create more complex formulas. For example, you can use the RANDBETWEEN function to generate a random number, and then use the INDEX function to select a value from a list based on that random number.

How to Generate a List of Random Numbers in Excel

If you need to generate a list of random numbers, you can use Excel’s random number generation functions in combination with the fill handle. Enter the formula for the first cell, and then drag the fill handle across the cells that you want to fill. Each cell will contain a new random number generated by the formula.

It’s important to note that Excel’s random number generation functions are based on a mathematical algorithm and are not truly random. However, they are still useful for many purposes, such as creating sample data for testing or simulations.

Additionally, you can customize the range of numbers that the random number generation function will produce by specifying the minimum and maximum values in the formula. This can be done by using the “RAND()” function in combination with the “RANDBETWEEN()” function, which allows you to specify the range of values that you want to generate.

Using Conditional Formatting to Highlight Randomly Generated Numbers in Excel

To make it easier to identify randomly generated numbers in a spreadsheet, you can use conditional formatting to highlight them. First, select the cells that contain the random numbers. Then, click on “Conditional Formatting” and choose “New Rule.” Select the “Use a formula to determine which cells to format” option, and enter a formula that tests whether the cell contains a random number. For example, to highlight all cells that contain a random number between 1 and 10, use the formula: =AND(A1>=1,A1<=10).

How to Create a Random Sampling of Data in Excel

If you have a large set of data and you need to create a statistically significant sample, you can use Excel’s random number generation functions in combination with the INDEX function. First, assign a random number to each row using the following formula: =RAND(). Then, use the INDEX function to extract a random sample from the data set. For example, to extract a random sample of 100 rows from a data set stored in cells A1:B100, use the following formula: =INDEX(A1:B100,RANK(RAND(),$A$1:$A$100),0).

Using Macros for Advanced Random Number Generation in Excel

Excel macros can be used to create more complex random number generators. Macros allow the user to define custom functions that can generate random numbers based on specific formulas or parameters. Macros can also be used to generate large sets of random numbers and to automate the data analysis process.

Common Mistakes to Avoid When Generating Random Numbers in Excel

When generating random numbers in Excel, it is important to avoid certain common mistakes. For example, be sure to use the RAND and RANDBETWEEN functions correctly. Also, always use a large enough sample size to ensure that the randomness is not compromised. Finally, be sure to test the validity of the random number generation process using statistical methods such as hypothesis testing.

Best Practices for Utilizing Generated Random Numbers in Excel Applications

To ensure the integrity of data analysis and decision-making processes, it is important to use best practices when using generated random numbers in Excel applications. Be sure to clearly document the process used to generate the random numbers. Also, always test the validity of the data by using statistical methods to analyze the results. Finally, use generated random numbers only when they are appropriate for the application at hand.

By humans, for humans - Best rated articles:

Excel report templates: build better reports faster, top 9 power bi dashboard examples, excel waterfall charts: how to create one that doesn't suck, beyond ai - discover our handpicked bi resources.

Explore Zebra BI's expert-selected resources combining technology and insight for practical, in-depth BI strategies.

random number generator 6 digits excel

We’ve been experimenting with AI-generated content, and sometimes it gets carried away. Give us a feedback and help us learn and improve! 🤍

Note: This is an experimental AI-generated article. Your help is welcome. Share your feedback with us and help us improve.

random number generator 6 digits excel

Lucky Lotto Numbers

Combinatorics

Possible 1 digit combinations, magic filters, display font, add/roll dice, random numbers, number converters, number formats, number lists.

Get it on Google Play

  • Ablebits blog
  • Random data

How to generate random numbers in Excel without duplicates

Svetlana Cheusheva

In this article, we'll discuss a few different formulas to randomize in Excel without repeating numbers. Also, we will show you a universal Random Generator that can produce a list of random numbers, dates, and strings with no repeats.

As you probably know, Microsoft Excel has several functions for generating random numbers such as RAND , RANDBETWEEN and RANDARRAY . However, there is no guarantee that the result of any function will be duplicate free.

This tutorial explains a few formulas for creating a list of unique random numbers. Please pay attention that some formulas only work in the latest version of Excel 365 and 2021 while others can be used in any version of Excel 2019, Excel 2016, Excel 2013 and earlier.

Get a list of unique random numbers with predefined step

Only works in Excel 365 and Excel 2021 that support dynamic arrays.

If you have the latest Excel version, the easiest way for you to get a list of unique random numbers is to combine 3 new dynamic array functions: SORTBY, SEQUENCE and RANDARRAY:

Where n is the number of random values you want to get.

For example, to create a list of 5 random numbers, use 5 for n :

=SORTBY(SEQUENCE(5), RANDARRAY(5))

Enter the formula in the topmost cell, press the Enter key, and the results will spill automatically over the specified number of cells.

Simple formula to produce a list of unique random numbers with predefined step

In the above formula, you only define how many rows to fill. All other arguments are left to their default values, meaning the list will start at 1 and will be incremented by 1. If you'd like a different first number and increment, then set your own values for the 3 rd ( start ) and 4 th ( step ) arguments of the SEQUENCE function.

For instance, to start at 100 and increment by 10, use this formula:

How this formula works:

Working from the inside out, here's what the formula does:

  • The SEQUENCE function creates an array of sequential numbers based on the specified or default start value and incrementing step size. This sequence goes to the array argument of SORTBY.
  • The RANDARRAY function creates an array of random numbers of the same size as the sequence (5 rows, 1 column in our case). The min and max value do not really matter, so we can leave these to defaults. This array goes to the by_array argument of SORTBY.
  • The SORTBY function sorts the sequential numbers generated by SEQUENCE using an array of random numbers produced by RANDARRAY.

Generate a list of random numbers with no duplicates

To generate random numbers in Excel without duplicates, use one of the below generic formulas.

Random integers :

Random decimals :

  • N is the number of values to generate.
  • Min is the minimal value.
  • Max is the maximum value.

For example, to create a list of 5 random integers from 1 to 100 with no repeats, use this formula:

To generate 5 unique random decimal numbers , put FALSE in the last argument of RANDARRAY or omit this argument:

At first sight the formula may look a bit tricky, but upon a closer look its logic is very straightforward:

  • The RANDARRAY function creates an array of random numbers based on the min and max values that you specify. To determine how many values to generate, you raise the desired number of uniques to the power of 2. Because the resulting array may have no one knows how many duplicates, you need to provide a sufficient array of values for UNIQUE to choose from. In this example, we need only 5 unique random numbers but we instruct RANDARRAY to produce 25 (5^2).
  • The UNIQUE function removes all duplicates and "feeds" a duplicate-free array to INDEX.
  • From the array passed by UNIQUE, the INDEX function extracts the first n values as specified by SEQUENCE (5 numbers in our case). Because values are already in random order, it does not really matter which ones survive.

Note. On very large arrays, this formula may be a bit slow. For example, to get a list of 1,000 unique numbers as the final result, RANDARRAY would have to generate of array of 1,000,000 random numbers (1000^2) internally. In such situations, instead of raising to power, you can multiply n by, say, 10 or 20. Just keep in mind please that the smaller array is passed to the UNIQUE function (small relative to the desired number of unique random values), the bigger the chance that not all cells in the spill range will be filled with the results.

Create a range of non-repeating random numbers in Excel

To generate a range of random numbers with no repeats, you can use this formula:

  • n is the number of cells to fill. To avoid manual calculations, you can supply it as (no. of rows * no. of columns). For example, to fill 10 rows and 5 columns, use 50^2 or (10*5)^2.
  • Rows is the number of rows to fill.
  • Columns is the number of columns to fill.
  • Min is the lowest value.
  • Max is the highest value.

As you may notice, the formula is basically the same as in the previous example. The only difference is the SEQUENCE function, which in this case defines both the number of rows and columns.

For instance, to fill a range of 10 rows and 3 columns with unique random numbers from 1 to 100, use this formula:

=INDEX(UNIQUE(RANDARRAY(30^2, 1, 1, 100)), SEQUENCE(10, 3))

If you need whole numbers, then set the last argument of RANDARRAY to TRUE:

How to generate unique random numbers in Excel 2019, 2016 and earlier

As no version other than Excel 365 and 2021 supports dynamic arrays, none of the above solutions work in earlier versions of Excel. However, this does not mean there is no solution at all, you'll just have to perform a few more steps:

  • The RAND function to generate random decimals between 0 and 1, or
  • The RANDBETWEEN function to produce random integers in the range that you specify.

Be sure to generate more values than you actually need because some will be duplicates and you'll delete them later.

For this example, we are creating a list of 10 random integers between 1 and 20 by using the below formula:

=RANDBETWEEN(1,20)

To enter the formula in multiple cells in one go, select all the cells (A2:A15 in our example), type the formula in the formula bar and press Ctrl + Enter . Or you can enter the formula in the first cell as usual, and then drag it down to as many cells as needed.

Done! All duplicates are gone, and you can now delete the excess numbers.

Tip. Instead of Excel's built-in tool, you can use our advanced Duplicate Remover for Excel .

How to stop random numbers from changing

All of the randomizing functions in Excel including RAND, RANDBETWEEN and RANDARRAY are volatile, meaning they recalculate every time the spreadsheet is changed. As the result, new random values are produced with every change. To prevent generating new numbers automatically, use the Paste Special > Values feature to replace formulas with static values. Here's how:

  • Select all the cells with your random formula and press Ctrl + C to copy them.
  • Right click the selected range and click Paste Special > Values . Alternatively, you can press Shift + F10 and then V , which is the shortcut for this option.

Random number generator for Excel with no repeats

The users of our Ultimate Suite do not really need any of the above solutions because they already have a universal Random Generator in their Excel. This tool can easily produce a list of non-repeating integers, decimals numbers, dates, and unique passwords. Here's how:

  • On the Ablebits Tools tab, click Randomize > Random Generator .
  • Select the range to fill with random numbers.
  • Choose the desired value type: integer, real number, date, Boolean, custom list, or string (ideal for generating strong unique passwords!).
  • Set up the From and To values.
  • Select the Unique values check box.
  • Click Generate .

Random number generator for Excel with no repeats

That's how to randomize numbers in Excel without duplicates. I thank you for reading and hope to see you on our blog next week!

Practice workbook for download

You may also be interested in.

  • How to select random sample in Excel
  • How to sort randomly in Excel
  • How to create a sequence of dates in Excel
  • How to prevent duplicates in column in Excel

Table of contents

Ablebits.com website logo

35 comments

random number generator 6 digits excel

I have tried to apply this formula =INDEX(UNIQUE(RANDARRAY(120^2, 1, 1, 50, TRUE)), SEQUENCE(15,8)) to get 15 rows * 8 columns of numbers 1 to 50 with no repeats in the rows. The formula works for like 5 or 6 rows correctly and then the #REF! error populates the other cells down.

Also, would it be possible to wrap this formula with a sortby function such that instead of the result reading as (eg. 38,15,16,4,12,46,43,48), I get the same values but sorted like this (4,12,15,16,38,43,46,48)

Please and Thanks,

random number generator 6 digits excel

Hi! You want to write 50 numbers in 120 cells without repeating them? Sorry, that is not possible. Increase the quantity of numbers. For example,

=INDEX(UNIQUE(RANDARRAY(120^2, 1, 1, 500, TRUE)), SEQUENCE(15,8))

Wow, that was quick. Thanks Alexander.

My apologies. Here is a better example of what happens S.No. 1 - 11,18,24,27,29,40,42,50 2 - 1,6,8,19,23,26,46,47 3 - 3,9,13,14,25,28,34,39 4 - 4,5,10,20,32,35,37,41 5 - 7,12,16,30,33,36,43,45 6 - 2,15,17,22,38,44,48,49 7 - 21,31,#REF!,#REF!,#REF!,#REF!,#REF!,#REF! 8 - #REF!,#REF!,#REF!,#REF!,#REF!,#REF!,#REF!,#REF! 9 - #REF!,#REF!,#REF!,#REF!,#REF!,#REF!,#REF!,#REF!

Did you use the formula I gave you?

i am in need of values from 1 to 50. replacing 50 with 500 does remove the #Ref! errors but does not help as the numbers are above 50.

Then find a way to place 50 numbers in 120 cells without repeating them. I think this will be very much appreciated.

random number generator 6 digits excel

That's perfect! Thank you very much, Svetlana!

random number generator 6 digits excel

I 'm using VBA with randombetween function and I think it is the best way to generate unique random numbers (as example range of random numbers between 100 to 1000) . The VBA code check the current generated number with all previous numbers if exist then it must be regenerated again and so on.

random number generator 6 digits excel

I have a random generator file for choosing swabbing sites. Once a year we need to go through all the sites, and we swab weekly. How can I format the file so that it does not ever duplicate a swab site for the year? Is this possible? We are randomly picking 7 sites weekly, but I don't want it to duplicate till all the sites have been swabbed, and then it could start over.

The equation I'm currently using is: =INDEX(UNIQUE(RANDARRAY(7^2,1,1,312,TRUE)),SEQUENCE(7))

I could randomize all 312 sites, just wondering if there is a better way to accomplish the task. Multiple people use the file, so I want something user friendly for everyone using it.

Is this possible to do in Excel?

Hello! Random values can only be generated over a continuous range of numbers. You can check the site check box in a separate column. Then you create a new list of unverified sites. Change the number 312 in the formula to a smaller one.

random number generator 6 digits excel

Hi There- I Loved these formulas!! It was super helpful, though I am trying to see if there is a related formula (or pair of them) for allowing 'less than e.g. 10% repeat rates. For example, if we started with 1500 product testers, and we had 100 testers per product, how could we generate groups of 100 per product such that no more than 10% of the 100 were repeats (i.e. groups of 100 were 90% unique). Thanks in advance for your insight! Best Regards, JF

Hello! Unfortunately, Excel formulas cannot control how many duplicates will appear in the list.

random number generator 6 digits excel

Hello! I am using this formula but need two columns of random numbers. 1-9 are the numbers. If first column number is 1-5 then second column needs to be greater than 5 and vica versa, if first column is >5 then second column 5 =<. I was thinking I’d have to imbed another formula into a if then? I’m pretty rusty with excel.

Hello! Sorry, I do not fully understand the task. What formula are you using? Write an example of the result you want to get.

Thanks for the reply! So I’m assigning daily schedules to 9 employees for Morning and afternoon. 9 schedules, 9 employees. I used =sortby(sequence(9),randarray(9)) to assign the AM schedules. For PM, anyone with a schedule 1-5 in AM should be assigned schedules 6-9 and if 6-9 in am, 1-5 in afternoon. I did a combination of IF and randbetween but of course get duplicates in afternoon

So far I need this to not have duplicates: =if(b12<=5,randbetween(6,9),randbetween1,4))

Hi! Write an example of what values you want to see in column B and column C. I think that for 5 people (1-5) it is impossible to assign 4 numbers (6-9) without duplicates! Or have I misunderstood something?

B. C 5. 7 3. 6 7. 4 4. 5 8. 1 6. 2 2. 3 1. 9

Hopefully formatting will hold when I post this.

Correction. That 9 in C column can be an 8. This example has 8 employees and 8 schedules. Different days have different numbers of employees available for schedules.

Hi! As far as I can see from your last comment, your task is now different from the original one. Your example result is completely different from what you wrote earlier. In these numbers, I do not see any pattern. I don’t think I can help with such a task.

random number generator 6 digits excel

I am also having a problem with the formula:

=INDEX(UNIQUE(RANDARRAY(4, 10, 1, 10, TRUE)), SEQUENCE(4), {1,2,3,4,5,6,7,8,9,10}).

I am basically trying to produce a Sudoku table much like the example above with the tennis players.

I want to have 4 inspectors test 10 parts with them testing at the same time (if part 1 is being tested by inspector 1, it cannot be available to the other 3 inspectors during that run and inspector 1 should only be shown part 1 one time).

The array should only produce 1 number across a row and column.

Hi! The information you provided is not enough to understand your case and give you any advice, sorry. Describe in detail what problem you have, and I will try to help you.

random number generator 6 digits excel

thanks for your blog. I have volunteered to build a tennis schedule for my club, this requires random teams of 4 for each of 4 time slot (total 16 per week). Unfortunately there are 20 players, so 4 'sit out' each week. E.G. week 1, players 1-16 play, (these are to be randomized) and players 17-20 'sit out'. In week 2 perhaps players 5-20 play and 1-4 'sit out'. Each number has a name associated with it. I tried this formula across my players both in and out =INDEX(UNIQUE(RANDARRAY(30^2,1,1,20,TRUE)),SEQUENCE(1,20)) but the 'out' players were treated like any other group of 4 and so they were not fairly randomized (they should only sit out 2 times in an 8 week rotation. I was wondering if there is a way to input a dynamic range so that each week it can look at my non randomized list of players who are out for a week and generate the random numbers from the residual list of 1-20 for my list of players :)

random number generator 6 digits excel

Any update to Richard's challenge up above? I'm in the same boat having volunteered to build a Pickleball schedule for my club and facing the same challenge

Hi! Your request goes beyond the advice we provide on this blog. This is a complex solution that cannot be found with a single formula. If you have a specific question about the operation of a function or formula, I will try to answer it.

random number generator 6 digits excel

Hello, thanks for this interesting topic. I wondered to know how to generate unrepeated random number starting always by the same number, like 12 for exemple?

Hi, The formula below will do the trick for you:

=--("12"&RANDBETWEEN(100,200))

I hope my advice will help you solve your task.

random number generator 6 digits excel

PREZADA EXISTE UMA FORMULA EM EXCEL PARA GERAR NUMEROS ALEOTÓRIOS EXCLUINDO ALGUNS. EX GERA RANDOM ENTRE 1 E 30 EXCLUINDO OS NUMEROS 11,24 E 29

random number generator 6 digits excel

Hi, I have a query regarding the following function:

=INDEX(UNIQUE(RANDARRAY(20, 3, 1, 100, TRUE)), SEQUENCE(10), {1,2,3})

You have provided this formula under the heading "Create a range of non-repeating random numbers in Excel". But the example array you have shown contains repeating numbers. Eg: 65 appears twice, 25 apears twice, 61 appears twice and so on. Your array does not appear to contain 30 unique random numbers, because several of them are repeated.

I am trying to create a 5 x 5 array, with randomly generated numbers between 1 and 50, without any duplicates. So the result I need is 25 unique numbers in the range 1 to 50, in a 5 x 5 table. This is my formula based on your example:

=INDEX(UNIQUE(RANDARRAY(50, 5, 1, 50, TRUE)), SEQUENCE(5), {1,2,3,4,5})

But I am yet to get a 5 x 5 array with 25 unique numbers. There are always several numbers that are repeated in the array, sometimes in duplicate, sometimes even in triplicate. I thought at first, maybe my range (1 to 50) is not big enough? So I extended it from 1 to 100, but still got repeating numbers.

In any case, I thought the UNIQUE function would weed out any duplicated numbers. So really, it shouldn't matter whether I have 1 to 50 or even 1 to 500 as my range, isn't the job of "UNIQUE" to stop two numbers that are the same from ending up in the array?

My question is: how can I get my 5 x 5 array to have 25 unique numbers with values between 1 and 50 without any duplication of numbers?

I am using the latest 365 version of Excel.

Thank you for any assistance you can offer.

random number generator 6 digits excel

The formula is incorrect, sorry for misleading you. Trying it figure it out now (and how I could have overlooked duplicate numbers in the screen). We will post an update asap. Again, my apologies for the inconvenience.

We have fixed the formula and updated the example (thanks to Alex , one of our best Excel gurus, for this solution!).

During my tests, the improved formula worked perfect with no repeats. We will appreciate if you could test it on your side too and let us know about your results. Thank you in advance!

random number generator 6 digits excel

In my question/comment, I meant to say that I'm interested in generating unique random numbers across rather than down.

Dear Dr. Rapoport,

If you use Excel 365, then you can find a solution in How to create a range of unique random numbers . That formula produces no duplicates in either rows or columns.

Generate random numbers without Ablebits works down columns. It does not seem to work across rows, because if I produce an array using any of these methods, there are often duplicates in a row. Is there a way to fix that? Thanks.

Hello! There are a lot of formulas in the article. Clarify which of them are you talking about? Try this formula

=INDEX(UNIQUE(RANDARRAY(2, 10, 1, 100)), SEQUENCE(1), {1,2,3,4,5,6,7,8,9,10})

Post a comment

Free All-in-One Office Suite with PDF Editor

Edit Word, Excel, and PPT for FREE.

Read, edit, and convert PDFs with the powerful PDF toolkit.

Microsoft-like interface, easy to use.

Windows • MacOS • Linux • iOS • Android

banner

  • Articles of Excel
  • Excel-How-to

How to Generate Random Numbers in Excel (Step-By-Step Guide)

How to Generate Random Numbers in Excel

In the realm of Excel, the task of generating random numbers holds both intrigue and complexity. The need is universal for crafting sample datasets, running simulations, or random selections.

Yet, Excel's array of randomizing functions—RAND(), RANDBETWEEN(), and RANDARRAY()—can bewilder users in their choice when they need to generate random numbers Excel.

How, then, to conquer this challenge? The answer unfolds in five distinct methods, each tailored to specific scenarios, enabling you to wield randomness with finesse.

Introduction to Random Numbers in Excel

In the world of Excel, the concept of random numbers goes beyond mere chance. A random number in excel, as the name suggests, is a value selected unpredictably from a defined set of numbers. This intrinsic randomness holds profound significance in various domains, most notably in the realm of data analysis.

Random numbers are of paramount importance in the world of data analysis due to their unique properties and applications. Here's why they hold such significance:

Statistical Simulations - In data analysis, simulations are used to model real-world scenarios. Random numbers inject unpredictability into these simulations, making them more realistic and capable of generating a wide range of outcomes.

Distribution Analysis - The uniform distribution of random numbers allows for the analysis of various data distributions. This aids in understanding patterns, trends, and anomalies within datasets.

Testing Hypotheses - Random numbers facilitate hypothesis testing by enabling the creation of controlled experiments. Researchers can introduce randomness to minimize bias and accurately assess the impact of different variables.

Cryptographic Security - Random numbers are integral to cryptographic systems, ensuring the generation of secure keys and codes. Without true randomness, encryption systems become vulnerable to attacks.

Monte Carlo Methods - These techniques rely on random sampling to solve complex mathematical problems and estimate numerical results. They find applications in fields such as finance, physics, and engineering.

In Excel, harnessing the power of random numbers opens doors to accurate statistical analysis, robust simulations, and informed decision-making across various disciplines.

Why Randomize Numbers in Excel?

Employing Excel to infuse randomness into numbers holds profound significance. From enhancing security in digital encryption to fostering impartiality in decision-making, the ability to randomize random numbers in Excel empowers users across diverse domains.

Consider the scientific realm, where precision is paramount. Excel's randomize numbers feature creates an unbiased foundation for computational programs by generating seed numbers. These seeds initiate calculations from a neutral starting point, guarding against bias and ensuring accurate outcomes.

In the world of choices, Excel's random number generator emerges as a fair arbiter. Whether designating roles in meetings or making selections, this tool eliminates human bias, fostering a level playing field for decisions.

How to Use Functions to Generate Random Numbers in Excel

Generating random numbers in Excel opens doors to versatile applications, from simulations to decision-making. Let's embark on a step-by-step journey through two key functions: RAND and RANDBETWEEN.

Function 1: The RAND Function - Generating Single Random Numbers

The RAND function in Excel is a powerhouse for generating random decimals between 0 and 1. It's as simple as entering =RAND() in a cell and copying the formula as needed. But the magic lies in customization:

Specifying an Upper Bound: To create random numbers within a range, say 0 to 50, use =RAND() 50. Remember, the upper bound isn't included, so for numbers between 0 and 10 (including 10), it's =RAND() 11.

Generating Between Two Numbers: For numbers between any range, like 10 and 50, employ =RAND() * (B - A) + A. Here, A is the lower bound and B is the upper bound.

Generating Random Integers: To get whole numbers, wrap the above formulas with INT. For instance, to create integers between 0 and 50: =INT(RAND() * 50).

Function 2: The RANDBETWEEN Function - Generating Random Integers

The RANDBETWEEN function offers a simpler path to random integers within a specified range. Just use =RANDBETWEEN(A, B), where A and B are your range boundaries.

Function 2: The RANDBETWEEN Function: Generating Random Integers

The RANDBETWEEN function in Excel is a handy tool for generating random integers within a specified range. It's especially useful when you need to create random data for various purposes, such as simulations, sampling, or testing. Here's a breakdown of the syntax and usage of the RANDBETWEEN function:

=RANDBETWEEN(bottom, top)

bottom: This is the lowest number in the range of random numbers you want to generate.

top: This is the highest number in the range of random numbers you want to generate.

Generating Random Integers within a Specified Range:

One of the primary use cases of the RANDBETWEEN function is to create random integers within a specific range. Let's look at a couple of examples:

Example 1: Generating Random Test Scores

Suppose you're a teacher and want to generate random test scores for your students between 60 and 100. To do this, you can use the RANDBETWEEN function:

=RANDBETWEEN(60, 100)

This formula will give you a random test score between 60 and 100 for each student, which you can use for grading or analysis.

Example 2: Simulating Dice Rolls

If you're a board game enthusiast and want to simulate a six-sided dice roll, you can use RANDBETWEEN. Each roll should produce a random integer between 1 and 6 (inclusive):

=RANDBETWEEN(1, 6)

This formula mimics the roll of a fair six-sided die, providing values from 1 to 6.

Real-world Example of RANDBETWEEN Function:

Imagine you're a teacher and want to randomly assign topics for presentations. By entering =RANDBETWEEN(1, 10), Excel will pick a number between 1 and 10, and you've got your topic! No duplicates, no repeats—just randomness guiding your decision.

In Excel's arsenal of functions, the ability to generate random numbers stands as a powerful tool. Whether for scientific exploration, unbiased selections, or statistical analysis, these functions elevate your Excel prowess and empower your data-driven journey.

Best Free Alternative - WPS Office

WPS Office

In the realm of office suites, WPS Office stands as a versatile and cost-free alternative for those seeking seamless compatibility and powerful features.

Whether you're crafting documents, crunching numbers, or designing presentations, WPS Office offers a compelling suite of tools that can open, create, edit, and save Microsoft Office files—Word, Excel, and PowerPoint—without costing you a dime.

Pros of WPS Office:

Free and Feature-Packed: WPS Office provides a robust set of tools for Word, Excel, and PowerPoint tasks, all available for free. Its powerful PDF toolkit further enhances its versatility.

Rich Template Store: Enhance your creative output with an extensive template store, offering a range of professionally designed templates to jumpstart your projects.

Lightweight: Occupying a mere 200MB, WPS Office is a lightweight solution that won't burden your computer memory. This efficiency extends its compatibility across Windows 7, 10, and 11.

Support for Online Documents: Seamlessly transition to the cloud with WPS AirPage, enabling multi-person collaborative editing on online documents.

WPS Office's MAC version isn't just an afterthought—it's a powerhouse. While Microsoft Office sometimes misses the mark for Mac users, WPS Office bridges the gap, catering to the unique needs of the Mac experience.

In a world where office productivity relies on seamless collaboration and diverse features, WPS Office steps up to the plate. Its lightweight design, comprehensive tools, and compatibility with both Windows and Mac make it an essential tool for your digital workspace.

Ready to Experience WPS Office?

Unlock the power of the WPS Office for free . Elevate your productivity today with a suite that embraces efficiency, collaboration, and creativity—all without breaking the bank.

Use Word, Excel, and PPT for FREE, No Ads.

Edit PDF files with the powerful PDF toolkit.

Microsoft-like interface. Easy to learn. 100% Compatibility.

Boost your productivity with WPS's abundant free Word, Excel, PPT, and CV templates.

This comprehensive guide delves into the art of generating a random number in Excel, offering a clear path for enhancing statistical tasks and decision-making. We unravel the significance of random numbers, from statistical simulations to cryptographic security, and explore methods to wield their power in Excel.

Learn the step-by-step utilization of functions like RAND and RANDBETWEEN, enabling you to create random numbers in Excel with precision. Furthermore, discover the impressive capabilities of the WPS Office, a free and feature-packed alternative that seamlessly opens, creates, edits, and saves Microsoft Office files.

With its lightweight design, rich template store, and support for online documents, WPS Office emerges as a dynamic tool for both Windows and Mac users, transcending the boundaries of productivity. Elevate your efficiency, creativity, and collaboration with the power of WPS Office.

  • 1. How to Extract Numbers from Cells With Letters and Numbers in Excel (3 Easy Steps)
  • 2. How to Use WPS AI to Generate Tagline for Free
  • 3. How to ROUNDUP Numbers in Google Sheets: A Step-by-Step Guide
  • 4. How to Use Wps AI/Chatgpt to Generate Charts A Comprehensive Guide for Beginners
  • 5. How to Format Phone Numbers in WPS Spreadsheet - A Step-By-Step Guide
  • 6. How to Sum Random Cells in Excel - The Ultimate Guide in 2024

random number generator 6 digits excel

15 years of office industry experience, tech lover and copywriter. Follow me for product reviews, comparisons, and recommendations for new apps and software.

ExcelDemy

How to Generate Random 10 Digit Number in Excel (6 Methods)

Avatar photo

In this tutorial, we will explain different methods to generate a random 10 digit number in Excel. While working on a project in Microsoft Excel sometimes we do not have any particular dataset. So, we have to create a sample one. While creating a sample dataset we may need to generate random numbers. Generally, we have to generate random numbers for a few instances. It’s not the kind of feature which we need to use frequently.

How to Generate Random 10 Digit Number in Excel: 6 Methods

Throughout the whole article, we will explain 6 methods to generate a random 10 digit number. We will use different functions, tools, and VBA code.

1. Combine ROUND and RAND Functions to Generate Random 10 Digit Number

First and foremost, we will use the ROUND function and the RAND function to generate a random 10 digits number.

In Microsoft Excel , the RAND function returns a random number between 0 and 1.

The ROUND function in Excel produces a number that has been rounded to a specified number of digits.

The names of five people are shown in the following image from our dataset. We’ll generate phone numbers for them at random, each with ten digits.

Combine ROUND and RAND Functions to Generate Random 10 Digit Number

Let’s see the steps to perform this action.

  • First, select cell C5 .
  • Next, type the following formula in that cell:
  • Press Enter .
  • So, the above action returns a random 10 digit number in cell C5 .
  • Then, drag the Fill Handle tool from cell C5 to cell C9 .
  • Finally, we get results like the following image.

random number generator 6 digits excel

🔎 How Does the Formula Work?

  • RAND()*9999999999+1: This part multiplies the random number generated by 9999999999 and adds 1 to it.
  • ROUND(RAND()*9999999999+1,0): This part rounds the result that we get from the RAND  function.

2. Use RANDBETWEEN Function to Create Random 10 Digit Number in Excel

In the second method, we will use the RANDBETWEEN function to generate a random 10 digit number in Excel.

The RANDBETWEEN function in Excel returns an integer number between two specified numbers.

To explain this method we will continue with our previous dataset.

random number generator 6 digits excel

Let’s see the steps to execute this method.

  • Firstly, select cell C5 and insert the following formula in that cell:
  • Hit Enter .
  • As a result, we get a random 10 digit number in cell C5 .
  • Secondly, drag the Fill Handle tool from cell C5 to the end of the dataset.
  • Lastly, we can see the results in the following image.

Use RANDBETWEEN Function to Create Random 10 Digit Number in Excel

3. Generate Random 10 Digit Number Based on Number of Digits You Type in Different Cell

In the third method, we will generate a random 10 digit number using a unique method. For instance, when we type 10 in cell C5 , cell D5 will show a random number of 10 digits within it.

Generate Random 10 Digit Number Based on Number of Digits You Type in Different Cell

We will follow the below steps to perform this method.

  • To begin with, insert the following formula in cells ( D5:D9 ):

random number generator 6 digits excel

  • In addition, type the value 10 in cell C5 .
  • Tap Enter .
  • Furthermore, we get a random 10 digit number in cell D5 .

random number generator 6 digits excel

  • Finally, input the value 10 in cells ( C6:C9 ). As a result, we also get random 10 digit numbers in cells ( D6:D9 ).

random number generator 6 digits excel

  • RANDBETWEEN(0,999999999999999): This part returns a random 10 digit number.
  • LEFT(RANDBETWEEN(1,9)&RANDBETWEEN(0,999999999999999)&RANDBETWEEN(0,999999999999999), C5): Returns a random number of fixed digits in cell D5 that we type in cell C5 .

4. Apply RANDARRAY Function to Generate Random 10 Digit Number

Another method to generate random numbers in a specific region in our dataset is to use the RANDARRAY function. The RANDARRAY function is only available in Microsoft Excel 365 & Microsoft Excel 2021 versions.

The RANDARRAY function provides a list of random numbers ranging from 0 to 1 which is specified by a number of rows and columns.

In the following dataset, we will randomly generate two phone numbers for each person with the RANDARRAY function.

Apply RANDARRAY Function to Generate Random 10 Digit Number

Let’s see the steps to use the RANDARRAY function.

  • In the beginning, select cell C5 .

Apply RANDARRAY Function to Generate Random 10 Digit Number

  • After that, tap Enter .
  • Finally, we get random numbers in cells ( C5:D9 ).

random number generator 6 digits excel

5. Generate10 Digit Number with Analysis Toolpak

Another method to generate a random 10 digit number in Excel is to use an Add-in named ‘ Analysis Toolpak ’. This method doesn’t require any formula.

To illustrate this method we will use the dataset of our first method. Just follow the below steps to perform this action.

  • Firstly, go to the File  tab.

Random 10 Digit Number Generating with Analysis Toolpak

  • Secondly, select Options from the menu.

Random 10 Digit Number Generating with Analysis Toolpak

  • A new pop-up window appears named ‘ Excel Options ’.
  • Thirdly, click on the option Add-ins on the left side of the window.
  • Next, on the right side scroll down to the bottom. Select the option ‘ Excel Add-ins ’ from the drop-down and click on the Go  button.

Random 10 Digit Number Generating with Analysis Toolpak

  • This will open a pop-up window with a list of all accessible Excel add-ins . Click OK after checking the box for ‘ Analysis ToolPak ’.

Random 10 Digit Number Generating with Analysis Toolpak

  • Then, select the ‘ Data Analysis ’ option from the Data  tab.

Random 10 Digit Number Generating with Analysis Toolpak

  • It opens a new pop-up window named ‘ Data Analysis ’.
  • Moreover, scroll down the options in the ‘ Analysis Tools ’ section. Select the ‘ Random Number Generation ’ option and then click OK .

random number generator 6 digits excel

  • After that, we get one more pop-up window named ‘ Random Number Generation ’. We will input values for different parameters to generate random 10 digit numbers.
  • The ‘ Number of Variables ’ field specifies how many columns we want to fill with random data. We have used the value 1 .
  • The number of rows is indicated by the ‘ Number of Random Numbers ’. We have taken the value 5 .
  • In the Distribution field, we have chosen the option Uniform .
  • Set the parameters to a range of 1 to 9999999999 .
  • Set the ‘ Output Range ’ to the array’s beginning which is cell C5 .
  • Now click on OK .

random number generator 6 digits excel

  • Finally, we can see randomly generated 10 digit numbers in cells ( C5:C9 ).

random number generator 6 digits excel

6. Insert VBA Code to Create 10 Digit Number in Excel

In the last method, we will generate a random 10 digit number with the use of a VBA code. To demonstrate this method we use the following dataset that we have also used earlier.

Insert VBA Code to Create 10 Digit Number in Excel

Follow the below steps to perform this method.

  • To begin with, right-click on the active sheet and select the option ‘ View Code ’.

random number generator 6 digits excel

  • The above command opens a new blank VBA code window for that worksheet.
  • In addition, insert the following code in the code window:
  • Furthermore, click on the Run or press the F5 key to run the code.

Insert VBA Code to Create 10 Digit Number in Excel

  • Lastly, we get 10 digit numbers generated at random in cells ( C5:C9 ).

random number generator 6 digits excel

Download Practice Workbook

We can download the practice workbook from here.

In conclusion, we can easily generate a random 10 digit number in Excel by following this method. To achieve the greatest results, download the practice workbook that has been attached to this article and put it to use. If you have any questions or recommendations, please leave a remark in the box below.

<< Go Back to Random Number in Excel | Randomize in Excel   |  Learn Excel

What is ExcelDemy?

Tags: Random Number in Excel

Mukesh Dipto

Mukesh Dipto is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a superhero tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including Rhino3D, Maxsurf C++, AutoCAD, HTML, CSS, JavaScript, and WordPress. He got his B.Sc in Naval Architecture & Marine Engineering from BUET, and now he's switched gears, working as a content developer. In this role, he... Read Full Bio

Leave a reply Cancel reply

ExcelDemy is a place where you can learn Excel, and get solutions to your Excel & Excel VBA-related problems, Data Analysis with Excel, etc. We provide tips, how to guide, provide online training, and also provide Excel solutions to your business problems.

Contact  |  Privacy Policy  |  TOS

  • User Reviews
  • List of Services
  • Service Pricing

trustpilot review

  • Create Basic Excel Pivot Tables
  • Excel Formulas and Functions
  • Excel Charts and SmartArt Graphics
  • Advanced Excel Training
  • Data Analysis Excel for Beginners

DMCA.com Protection Status

Advanced Excel Exercises with Solutions PDF

ExcelDemy

IMAGES

  1. Generate Random Numbers With Excel's RAND Function

    random number generator 6 digits excel

  2. Generate Random Numbers With Excel's RAND Function

    random number generator 6 digits excel

  3. How to Generate Random Numbers in Excel (3 Different Ways)

    random number generator 6 digits excel

  4. How to Generate Random Numbers in Excel (3 Different Ways)

    random number generator 6 digits excel

  5. RANDBETWEEN to Create Random Number Generator in Excel

    random number generator 6 digits excel

  6. How to Generate Random Numbers in Excel (3 Different Ways)

    random number generator 6 digits excel

VIDEO

  1. random number generator chooses the books i read

  2. Random Number Generator Challenge Part 2 #fyp #book #books #bookish #randomnumbergeneratorchallenge

  3. RANDOM OTP GENERATOR IN JAVA

  4. Generate random numbers with decimals in Excel

  5. 6/45 Nanum Lotto or any Lottery Generetor, Using Excel on your laptop or Mobile your self

  6. Random number generator electronic kit from electronic goldmine

COMMENTS

  1. 5 Ways to Generate Random Numbers in Excel

    But you can use a simple formula involving the RAND function to generate random numbers between any two numbers. = RAND ( ) * ( Y - X ) + X. In general, you can create a random number between X and Y by using the above formula. = RAND ( ) * 9 + 1. For example, to generate numbers between 1 and 10 you can use the above formula.

  2. Generate random number with the given specific length in Excel

    Random number in a given specific length with using formula. Random number in a fixed length. Supposing you want to generate a random number string in 6-digit length, you can use this formula. =RANDBETWEEN (100000,999999) Press Enter key, then then a random number in 6-digit length is outputted. Note: The output number will be changed when ...

  3. RAND and RANDBETWEEN functions to generate random numbers in Excel

    Formula 1. Specify the upper bound value of the range. To generate random numbers between zero and any N value, you multiple the RAND function by N: RAND ()* N. For example, to create a sequence of random numbers greater than or equal to 0 but less than 50, use the following formula: =RAND()*50. Note.

  4. RAND function

    To generate a random real number between a and b, use: =RAND ()* (b-a)+a. If you want to use RAND to generate a random number but don't want the numbers to change every time the cell is calculated, you can enter =RAND () in the formula bar, and then press F9 to change the formula to a random number. The formula will calculate and leave you with ...

  5. How to Generate Random Numbers in Microsoft Excel

    Head to the Data tab and click "Data Analysis" in the Analysis section of the ribbon. When the window appears, select "Random Number Generation" and click "OK." Starting at the top of the window, enter the number of columns you want to fill using the Number of Variables box. Then, enter the number of rows in the Number of Random Numbers box.

  6. How to Generate Random Numbers in Excel

    Here are the steps to generate random numbers using RANDBETWEEN: Select the cell in which you want to get the random numbers. In the active cell, enter =RANDBETWEEN (1,100). Hold the Control key and Press Enter. This will instantly give me 10 random numbers in the selected cells.

  7. Excel RANDARRAY function

    How to generate random numbers without duplicates. Though modern Excel offers 6 new dynamic array functions, unfortunately, there is still no inbuilt function to return random numbers without duplicates. To build your own unique random number generator in Excel, you will need to chain several functions together like shown below. Random integers:

  8. Generate Random Numbers in Excel (5 Easy Ways + VBA)

    Let's get a set of random numbers with this formula: =RAND()*11+1. The syntax becomes: =RAND()*(b-a)+a. //b - Maximum number to generate. //a - Minimum number to generate. 11 comes from deducting the minimum value from the maximum value. Since we want random numbers between 1 and 12, 12-1=11. Then the minimum value is added at the end of ...

  9. How to Use Random Number Generator in Excel (6 Examples)

    2.2 Create Random Numbers with Specified Decimal Places. To use the RANDBETWEEN function as a random number generator with 1 decimal place, type the formula: =RANDBETWEEN(5*10, 50*10)/10. To get up to 2 decimal places, replace 10 in the formula with 100. For 3 decimal places, replace with 1000.

  10. 3 Easy Ways to Generate Random Numbers In Excel

    USING RAND () Start by inputting the formula =RAND () in the cell. Press ENTER and it will immediately show a random number. Drag down the formula to increase the range that you want. To ensure that the random numbers in the cells don't change: Copy the cells. On the first cell, press RIGHT CLICK. Select PASTE OPTION, choose VALUES.

  11. How to Generate Random Numbers in Excel: RAND & RANDBETWEEN

    Write the RANDBETWEEN function as follows: = RANDBETWEEN (0,100) In the above function, 0 is the bottom and 100 is the top. This tells Excel to generate a random number that falls between 0 to 100. In other words, an integer that is equal to or greater than 0 but smaller or equal to 100 . Hit "Enter" and there you go.

  12. Generate Random Numbers in Excel (In Easy Steps)

    The RAND function generates a random decimal number between 0 and 1. 1. Select cell A1. 2. Type =RAND () and press Enter. The RAND function takes no arguments. 3. To generate a list of random numbers, select cell A1, click on the lower right corner of cell A1 and drag it down. Note that cell A1 has changed.

  13. How to Generate Random Numbers in Excel (Without Duplicates)

    In the first cell (A2), type: =RAND (). This will generate a random number between 0 and 1. Pull down the fill handle (located at the bottom right corner of the cell) to copy the formula to as many cells as you need. So if you want 10 random numbers, copy it down to cell A11.

  14. Random Generator for Excel

    Random Generator for Excel will fill your cells with random integers, real numbers, dates, Booleans, and strings. With this tool, you can easily generate random numbers without duplicates, get a list of secure passwords, and randomize values from your custom list. Just choose a range, select the desired option and click Generate.

  15. How to Generate Random Numbers in Excel

    Step 1: Select a Cell. Start by selecting the cell where you want to generate the random number. Step 2: Enter the RAND Function. Next, type "=RAND ()" into the selected cell. Press enter, and a random decimal number between 0 and 1 will appear in the cell. Step 3: Copy and Paste the RAND Function.

  16. How to Generate Random Numbers in Excel

    How to Generate Random Decimal Numbers in Excel. If you need to generate random decimal numbers within a specific range, you can use the following formula: = (RAND ()* (b-a))+a, where a is the lower limit and b is the upper limit. For example, to generate a random decimal number between 10 and 20, use the formula: = (RAND ()* (20-10))+10.

  17. Random 6 Digit Number Generator

    Possible 6 digit combinations. 1,000,000 (~ 1.0m) Random 2 Digit Number Generator Pick Random Numbers.

  18. Random Number Generator in Excel with No Repeats (9 Methods)

    9. Analysis Toolpak as Random Number Generator in Excel. Lastly, if you need to generate the random numbers without repetition instead of using the Excel formulas, you may use the following Add-ins of Excel.. To use the Add-ins, follow the steps below.. ⇰ Go to File > Options.. ⇰ Click on the Add-ins and select Excel Add-ins from the drop-down list and pick the option Go.

  19. How to generate random numbers in Excel with no repeats

    Where n is the number of random values you want to get.. For example, to create a list of 5 random numbers, use 5 for n: =SORTBY(SEQUENCE(5), RANDARRAY(5)) Enter the formula in the topmost cell, press the Enter key, and the results will spill automatically over the specified number of cells.. As you can see in the screenshot below, this formula actually sorts numbers from 1 to 5 in random order.

  20. Random Number Generator between Range in Excel (8 Examples)

    1. Use Excel RAND Function to Generate Number between a Range. You can use the RAND function as a random number generator. Usually, this function creates random numbers between 0 to 1. Steps: First. write the below formula in Cell B5. Hit Enter. As expected, you will get a number between 0 to 1.

  21. How to Generate Random Numbers in Excel (Step-By-Step Guide)

    Generating Between Two Numbers: For numbers between any range, like 10 and 50, employ =RAND () * (B - A) + A. Here, A is the lower bound and B is the upper bound. Generating Random Integers: To get whole numbers, wrap the above formulas with INT. For instance, to create integers between 0 and 50: =INT (RAND () * 50).

  22. How to Generate Random 10 Digit Number in Excel (6 Methods)

    1. Combine ROUND and RAND Functions to Generate Random 10 Digit Number. First and foremost, we will use the ROUND function and the RAND function to generate a random 10 digits number.. In Microsoft Excel, the RAND function returns a random number between 0 and 1.. The ROUND function in Excel produces a number that has been rounded to a specified number of digits.