TechBeamersTechBeamers
  • Learn ProgrammingLearn Programming
    • Python Programming
      • Python Basic
      • Python OOP
      • Python Pandas
      • Python PIP
      • Python Advanced
      • Python Selenium
    • Python Examples
    • Selenium Tutorials
      • Selenium with Java
      • Selenium with Python
    • Software Testing Tutorials
    • Java Programming
      • Java Basic
      • Java Flow Control
      • Java OOP
    • C Programming
    • Linux Commands
    • MySQL Commands
    • Agile in Software
    • AngularJS Guides
    • Android Tutorials
  • Interview PrepInterview Prep
    • SQL Interview Questions
    • Testing Interview Q&A
    • Python Interview Q&A
    • Selenium Interview Q&A
    • C Sharp Interview Q&A
    • PHP Interview Questions
    • Java Interview Questions
    • Web Development Q&A
  • Self AssessmentSelf Assessment
    • Python Test
    • Java Online Test
    • Selenium Quiz
    • Testing Quiz
    • HTML CSS Quiz
    • Shell Script Test
    • C/C++ Coding Test
Search
  • Python Multiline String
  • Python Multiline Comment
  • Python Iterate String
  • Python Dictionary
  • Python Lists
  • Python List Contains
  • Page Object Model
  • TestNG Annotations
  • Python Function Quiz
  • Python String Quiz
  • Python OOP Test
  • Java Spring Test
  • Java Collection Quiz
  • JavaScript Skill Test
  • Selenium Skill Test
  • Selenium Python Quiz
  • Shell Scripting Test
  • Latest Python Q&A
  • CSharp Coding Q&A
  • SQL Query Question
  • Top Selenium Q&A
  • Top QA Questions
  • Latest Testing Q&A
  • REST API Questions
  • Linux Interview Q&A
  • Shell Script Questions
© 2024 TechBeamers. All Rights Reserved.
Reading: How to Generate Random Numbers in Excel
Font ResizerAa
TechBeamersTechBeamers
Font ResizerAa
  • Python
  • SQL
  • C
  • Java
  • Testing
  • Selenium
  • Agile Concepts Simplified
  • Linux
  • MySQL
  • Python Quizzes
  • Java Quiz
  • Testing Quiz
  • Shell Script Quiz
  • WebDev Interview
  • Python Basic
  • Python Examples
  • Python Advanced
  • Python OOP
  • Python Selenium
  • General Tech
Search
  • Programming Tutorials
    • Python Tutorial
    • Python Examples
    • Java Tutorial
    • C Tutorial
    • MySQL Tutorial
    • Selenium Tutorial
    • Testing Tutorial
  • Top Interview Q&A
    • SQL Interview
    • Web Dev Interview
  • Best Coding Quiz
    • Python Quizzes
    • Java Quiz
    • Testing Quiz
    • ShellScript Quiz
Follow US
© 2024 TechBeamers. All Rights Reserved.
Technology

How to Generate Random Numbers in Excel

Last updated: Feb 04, 2024 12:35 am
By Meenakshi Agarwal
Share
5 Min Read
Generate Random Numbers in Excel Using Multiple Ways
SHARE

If you’re into Excel and want to make it work some magic, creating random numbers is a cool thing to learn. It’s useful for a bunch of stuff, like testing, making pretend data, or just adding a bit of randomness to your spreadsheets. Let’s dive into some simple ways to do it.

Contents
1. Using the RAND Function:Example 1.1: The BasicsExample 1.2: Picking a Range2. Using the RANDBETWEEN Function:Example 2.1: Whole Numbers3. Generating Random Dates in ExcelExample 3.1: Random Dates4. Using the NEW Function (Excel 365 and Excel 2021):Example 4.1: Unique Random Numbers5. Generating a Random List in Excel:Example 5.1: List of Random Numbers6. Generating Random Text:Example 6.1: Random TextTips and Tricks:Tip 1: RecalculationTip 2: Fixed Random NumbersTip 3: SortingTip 4: Random SamplingTip 5: Data Validation

A Simple Guide to Generate Random Numbers in Excel

Here are some of the super easy ways to generate random numbers in Excel. Go through the below sections and let us know for any queries.

1. Using the RAND Function:

To get started, there’s a basic function called RAND() that gives you a random number between 0 and 1. It’s like rolling a dice, but with decimals.

Example 1.1: The Basics

Just type = RAND() in a cell, and every time you mess with your sheet, it’ll give you a new random number.

Example 1.2: Picking a Range

Now, if you want your random numbers between certain values, use this formula:

= RAND() * (max - min) + min

So, if you want numbers between 10 and 50:

= RAND() * (50 - 10) + 10

2. Using the RANDBETWEEN Function:

For whole numbers, there’s a nifty function called RANDBETWEEN(min, max).

Example 2.1: Whole Numbers

Type in something like this:

= RANDBETWEEN(1, 100)

This gives you a whole number between 1 and 100 every time.

3. Generating Random Dates in Excel

You can even get Excel to make random dates for you. Perfect for planning or making schedules more interesting!

Example 3.1: Random Dates

Use this formula:

= RAND() * (end_date - start_date) + start_date

If you want random dates in 2024:

= RAND() * (DATE(2024, 12, 31) - DATE(2024, 1, 1)) + DATE(2024, 1, 1)

4. Using the NEW Function (Excel 365 and Excel 2021):

For the latest Excel versions, there’s an even newer NEW() function. It’s like RAND(), but fancier.

Example 4.1: Unique Random Numbers

Just type:

= NEW()

It gives you a fresh random number every time you mess with the sheet.

5. Generating a Random List in Excel:

Say you want a list of random numbers. Easy peasy with RANDARRAY().

Example 5.1: List of Random Numbers

Just do this:

= RANDARRAY(5, 1)

This makes a column of 5 random numbers.

6. Generating Random Text:

If you’re feeling wild, Excel can even make random text. Mix it up with uppercase and lowercase letters!

Example 6.1: Random Text

Try this formula:

= CHAR(RANDBETWEEN(65, 90)) & CHAR(RANDBETWEEN(97, 122))

You get a random uppercase letter followed by a random lowercase letter.

Tips and Tricks:

Tip 1: Recalculation

Formulas with random stuff recalculate every time you mess with the sheet. If you want it to stay the same, press F9.

Tip 2: Fixed Random Numbers

If you want the numbers to stay put, copy the cells, right-click on where you want them, and pick “Paste Special” > “Values.”

Tip 3: Sorting

For big sets of data, sorting can be handy. Use the “Sort” button to tidy things up.

Tip 4: Random Sampling

Want a random sample from a list? Combine INDEX() and RANDBETWEEN() like this:

= INDEX(A:A, RANDBETWEEN(1, COUNTA(A:A)), 1)

Tip 5: Data Validation

If you want to get random numbers based on what someone picks, try using data validation. It’s like a dropdown menu for your cells.

In a Nutshell: Generate Random Numbers in Excel

Creating random numbers in Excel is pretty cool and can be handy in different situations. From simple stuff with RAND() and RANDBETWEEN() to the newer NEW() function and random dates or text, there’s a lot you can do. The tips and tricks shared here should help you make the most out of Excel’s bag of tricks. Give these methods a go and have fun adding some randomness to your Excel adventures!

Happy Learning,
Team TechBeamers

You Might Also Like

How to Fix Load CSS Asynchronously

Postman Random APIs to Generate Unique Test Inputs

How to Fix Accessibility Issues With Tables in WordPress

Apache Spark Introduction and Architecture

Difference Between Spring and Spring Boot

TAGGED:Random Data Generation Made Easy
Meenakshi Agarwal Avatar
By Meenakshi Agarwal
Follow:
Hi, I'm Meenakshi Agarwal. I have a Bachelor's degree in Computer Science and a Master's degree in Computer Applications. After spending over a decade in large MNCs, I gained extensive experience in programming, coding, software development, testing, and automation. Now, I share my knowledge through tutorials, quizzes, and interview questions on Python, Java, Selenium, SQL, and C# on my blog, TechBeamers.com.
Previous Article peed Up Your Website Performance for Faster Loading How to Speed Up Your Website for Faster Loading
Next Article Python Random Sampling Explained with Examples A Beginner’s Guide to Python Random Sampling

Popular Tutorials

SQL Interview Questions List
50 SQL Practice Questions for Good Results in Interview
SQL Interview Nov 01, 2016
Demo Websites You Need to Practice Selenium
7 Sites to Practice Selenium for Free in 2024
Selenium Tutorial Feb 08, 2016
SQL Exercises with Sample Table and Demo Data
SQL Exercises – Complex Queries
SQL Interview May 10, 2020
Java Coding Questions for Software Testers
15 Java Coding Questions for Testers
Selenium Tutorial Jun 17, 2016
30 Quick Python Programming Questions On List, Tuple & Dictionary
30 Python Programming Questions On List, Tuple, and Dictionary
Python Basic Python Tutorials Oct 07, 2016
//
Our tutorials are written by real people who’ve put in the time to research and test thoroughly. Whether you’re a beginner or a pro, our tutorials will guide you through everything you need to learn a programming language.

Top Coding Tips

  • PYTHON TIPS
  • PANDAS TIPSNew
  • DATA ANALYSIS TIPS
  • SELENIUM TIPS
  • C CODING TIPS
  • GDB DEBUG TIPS
  • SQL TIPS & TRICKS

Top Tutorials

  • PYTHON TUTORIAL FOR BEGINNERS
  • SELENIUM WEBDRIVER TUTORIAL
  • SELENIUM PYTHON TUTORIAL
  • SELENIUM DEMO WEBSITESHot
  • TESTNG TUTORIALS FOR BEGINNERS
  • PYTHON MULTITHREADING TUTORIAL
  • JAVA MULTITHREADING TUTORIAL

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

Loading
TechBeamersTechBeamers
Follow US
© 2024 TechBeamers. All Rights Reserved.
  • About
  • Contact
  • Disclaimer
  • Privacy Policy
  • Terms of Use
TechBeamers Newsletter - Subscribe for Latest Updates
Join Us!

Subscribe to our newsletter and never miss the latest tech tutorials, quizzes, and tips.

Loading
Zero spam, Unsubscribe at any time.
x