Inside The Web
    Facebook Twitter Instagram
    Inside The Web
    • Office
      • Excel
      • Ms Word
      • Gmail
    • Productivity
      • Time Management
      • Task Automation
    Inside The Web
    Home»Excel»How to Get Random Number in Excel

    How to Get Random Number in Excel

    AsmiBy AsmiFebruary 8, 2023 Excel 3 Mins Read

    If you’re working with a new template, adding numbers will get you an idea of how the template will look when it’s in use. Similarly, you will definitely need numbers to test a newly created formula.

    However, manually entering numbers into your grid can be quite bothersome. To automate the process, Excel has two library functions to help you generate random numbers. You can choose between the RAND() and RANDBETWEEN() functions depending on if you wish to generate a random integer value or, a number between a specific range.

    Use RAND() Function

    RAND Function Excel

    The RAND function returns a random integer number between 0 and 1. The function does not require you to enter any arguments. Simply select the cell you wish to add your random number then enter =RAND().

    Flash Fill RAND Excel

    To generate more numbers, simply drag the fill handle from the bottom-right corner of the cell with your formula. Drop the handle where you wish to extend the formula till. If the value changes, it’s because you’ve set your calculation settings to Automatic.

    Excel refreshes its formulas every time a new formula is entered. As RAND() is a formula as well, the formula is refreshed, triggering Excel to generate a new value each time.

    Use RANDBETWEEN() Function

    RANDBETWEEN Function Excel

    If you want to generate a random number from a specific range, the RANDBETWEEN() function is perfect for you. Unlike RAND(), you will have to enter two arguments for the RANDBETWEEN() function. Once you open the parenthesis, enter your lower value then enter your upper limit. This function will also only return whole numbers, not integers.

    Flash Fill RANDBETWEEN Excel

    For example, if we’re looking to generate a random number between 50 and 100, our formula will look something like this:

    =RANDBETWEEN(50,100)

    Similar to the RAND() function, if you use Flash Fill to fill the adjacent cells, the values might refresh so you need to consider that if you’re using the value to test a formula.

    Change Generated Values

    If you’re not satisfied with the generated values, you can refresh your Excel workbook to get a new number. However, for this to work, you need to make sure your calculations are set to Automatic. Simply, from the Formula tab, navigate to Calculation options > Automatic.
    Automatic Calculation

    After you’ve set the calculation options to Automatic, on your keyboard, use the F9 key to refresh your worksheet. You can refresh your tab until you get the number you desire.

    Prevent Excel From Changing Random Values

    The volatile nature of these formulas can be a problem if you’re using these values to test a formula. To lock the data, you will have to copy your range and use the Paste Value option from the Paste Options. What this will do is paste only the value and not the formula, keeping your data constant.

    Paste Special

    Select your data range and copy it (Ctrl + C). Right-click on the same location and hit the V key on your keyboard. This will paste only the value and not the formula from your copied data.

    Excel Basics
    Asmi

      Asmi is a content writer specializing in MS Office. She loves writing Excel-related content to assist other users to learn their way around the program. She started using Excel when she first entered the industry as a marketing intern. Soon, she realized that learning the often-overlooked spreadsheet program was no piece of cake. In her articles, she attempts to brief out complex topics to help beginner to intermediate-level Excel users. Asmi uses Excel for everything, including creating a grocery list to managing her personal finance. She’s a bit dramatic when it comes to the Flash Fill feature; so much so that could write a eulogy out of it. When she’s not working, you’ll find her learning a new recipe, or cleaning up her mess (out of the failed recipe).

      Add A Comment
      Table of Contents
      • Use RAND() Function
      • Use RANDBETWEEN() Function
      • Change Generated Values
      • Prevent Excel From Changing Random Values
      Recent Posts
      • How to Calculate Discount Percentage in Excel
      • How to Create a Progress Bar in Excel
      • What is VSTACK in Excel
      • How to Separate Dates in Excel
      • How to Lock a Cell in Excel Formula
      • Home
      • Privacy Policy
      © 2023 Inside The Web

      Type above and press Enter to search. Press Esc to cancel.