Excel ships three native random functions — RAND, RANDBETWEEN, and RANDARRAY — and the difference between them decides whether you get a decimal between 0 and 1, an integer inside a chosen range, or an array of values that fills a whole block of cells at once. The formulas work without any add-in, but they also recalculate every time the workbook calculates, which is exactly what most readers need and exactly what some readers want to avoid. This guide walks through each built-in method with concrete syntax, then introduces a private browser-based Random Number Generator that produces 1 to 1,000 integers from a range you define, ready to paste straight into a sheet. Comparing the two paths side by side helps you pick the right one for classroom drawings, randomized test data, fair order selection, and any other ordinary task that needs unpredictable whole numbers or fractions inside Excel. The form of the answer depends on whether you need integers only, decimals, a single value, or an array of values, and on whether recalculation is a feature or a nuisance for the workbook you are building.

how to generate random numbers in excel
how to generate random numbers in excel

Three Built-In Ways to Generate Random Numbers in Excel

Excel's three stock functions cover the common cases without any setup. Each one is volatile, meaning the value changes every time the sheet recalculates, so remember that pressing F9, entering data, or opening the file on another machine produces a new draw.

  • RAND() — returns an evenly distributed real number greater than or equal to 0 and less than 1. Type =RAND() in a cell and press Enter to see something like 0.3742. Multiply or add to remap: =RAND()*100 gives 0 through 100, and =RAND()*50+10 gives 10 through 60 with decimals. Wrap in =INT(RAND()*100)+1 for an integer between 1 and 100 when RANDBETWEEN is unavailable in your version.
  • RANDBETWEEN(min, max) — returns a single integer between the bounds, including both endpoints. Use =RANDBETWEEN(1, 100) for a dice-style draw or =RANDBETWEEN(-50, 50) when negative values are needed. This is the shortest path to whole numbers in any Excel version that supports the function.
  • RANDARRAY(rows, columns, min, max, integer) — fills a range at once. =RANDARRAY(10, 1, 1, 50, TRUE) writes ten integers between 1 and 50 in a column, and =RANDARRAY(5, 5) writes twenty-five decimals between 0 and 1 in a 5×5 block. Set the fifth argument to FALSE or omit it for decimals, TRUE for integers. RANDARRAY is part of the dynamic-array family and requires Excel 365 or Excel 2021.

If you need unique integers from a small range, set a count with =SEQUENCE and feed the combined range into Remove Duplicates on the Data tab, or combine RANDARRAY output with a helper sort. Built-in random functions do not guarantee uniqueness on their own. Once you have a randomized list, it often feeds into another Excel workflow such as splitting a roster into balanced groups — see this guide to generating random teams in Excel for the next step from the same starting point.

Generate Random Integers With a Private Browser Tool

For workbooks that must hold stable numbers, for classes where every student gets the same starting prompt, or for ranges and counts that are awkward to type as formulas, a browser-based generator removes the recalculation problem entirely. The Random Number Generator accepts integer bounds and returns a comma-separated list that copies into the clipboard in one click, with nothing sent to a server because the math runs locally in the browser tab.

  1. Enter the minimum and maximum safe integers in the two bound fields; both endpoints are eligible results, so 1 and 10 in the same range can both appear in the output.
  2. Choose how many results you want, from 1 to 1,000 per operation, and decide whether duplicates are allowed using the on-screen toggle.
  3. Select Generate numbers; the comma-separated list appears below, ready to select and copy with the standard clipboard shortcut.
  4. Switch back to Excel, click the target cell, and paste with Ctrl+V, or use Paste Special if you want values without a trailing delimiter.

For a quick, plain-text cleanup in Excel, drop the pasted values into a single cell and run Text to Columns on the Data tab with Comma as the delimiter, or paste directly into a row or column if the tool happens to produce one value per line. Changing any bound, count, or duplicate setting clears the previous list so an old result is never mistaken for new output.

Move Generated Numbers Into Excel Without the Sheet Recalculating

The single biggest practical difference between formula-based random numbers and pasted values is volatility. Every formula recalculates when the workbook opens, when a cell in its dependency chain changes, or when you press F9 to force a calculation. Pasted numbers stay put. Three patterns cover most real cases:

  • Lock the formula once. Type a volatile formula such as =RANDBETWEEN(1, 100), copy the cell, then paste back with Paste Special > Values Only (Alt, E, S, V in older Excel versions). The visible number remains, but the volatility goes away and the cell behaves like any other static value.
  • Generate in the browser, paste in Excel. Use the Random Number Generator to draw a list, click the first target cell, and paste. Select Paste Special > Transpose if you need the row turned into a column or vice versa.
  • Split a comma-separated list. Paste a comma-separated string into a single cell, then run Data > Text to Columns with Comma as the delimiter. Each integer lands in its own cell without any spreadsheet function calculating it, so the values stay fixed from that moment on.

Pasted values integrate with sorting, filtering, conditional formatting, charts, and pivot tables just like typed numbers, so the rest of the workbook does not have to change. The choice between pasting and formulas mostly comes down to whether you want the workbook to keep generating fresh numbers or to lock in one specific draw.

Which Method Fits Which Task

Each approach has a sweet spot. The table below summarizes where the built-in functions shine and where a browser-based generator is the simpler choice. Exact counts and figures for any specific draw come from the tool itself rather than being computed on the page.

TaskBest MethodWhy
Single decimal for a probability check=RAND()Native, recalculates for repeated Monte Carlo trials
One integer inside a small range=RANDBETWEEN(1, N)Shortest syntax, both ends inclusive
Whole block of integers at once=RANDARRAY(rows, cols, min, max, TRUE)One formula fills the range in modern Excel
Negative bounds, mixed ranges, 1 to 1,000 resultsRandom Number GeneratorInclusive, browser-only, comma-separated output
Results that must not change laterBrowser tool plus Paste Special > ValuesRemoves volatility that comes with formulas
Unique integers across a small rangeBrowser tool with duplicates off, then sortTool guarantees no repeats inside one draw
Regulated prize drawings, audit-required picksAudited specialist systemBrowser tool publishes no audit trail by design

Why the Browser Tool Stays Unbiased Across the Whole Range

A common failure in homemade random scripts is modulo bias: when the range size does not divide evenly into the random source size, the lower numbers come up slightly more often than the higher ones. The browser generator avoids that by pulling 32-bit words from Crypto.getRandomValues, combining two of them into a 53-bit nonnegative integer, then throwing away any value that would fall into the incomplete tail before mapping into the requested range. The accepted values are spread evenly, so each integer in the inclusive range receives the same number of possible raw values.

When duplicates are allowed, each draw is independent and the same number may appear several times in a single output, which is the right behavior for repeated simulations or events where earlier results should remain eligible. When duplicates are off, a sparse partial Fisher-Yates shuffle selects unique offsets in memory proportional to the count you requested rather than to the size of the range, so picking 50 unique values from a range of one million integers still runs quickly. Validation happens before drawing: non-integer entries, blank fields, reversed bounds, infinity, unsafe integers, and requests that ask for more unique numbers than the range contains are all rejected with a clear error.

Inputs are limited to JavaScript safe integers because larger numeric text cannot always be represented exactly by ordinary browser numbers, and the inclusive range itself must have an exactly representable safe-integer size. If your task runs past these limits — extreme counts, encrypted keys, signed audits, or values wider than the safe-integer range — switch to a tool designed for that job. For ordinary classroom, drafting, test-data, and selection work, the combination of inclusive bounds, count, and duplicate toggle covers nearly every realistic case.

Limits, Errors, and When to Use Something Else

Each Excel method has its own ceiling. RAND and RANDBETWEEN change on every recalculation and stop being useful the moment you need a stable record. RANDARRAY needs Excel 365 or 2021; if the workbook will travel between older versions, dynamic-array spills look different from legacy entered ranges. The browser generator caps each operation at 1,000 results and refuses draws that ask for more unique values than the inclusive range contains, so a request for five unique results from 1 through 3 is reported as impossible rather than silently returning fewer numbers.

A practical guard for consequential picks: this tool is intentionally simple and explicitly does not publish a seed, signed transcript, external randomness beacon, or reproducible audit trail. Classroom raffles, prototype simulations, randomized test data, order selection, and game setup are exactly its use case. Anything that needs to be defensible afterward — prize drawings with legal exposure, access control, password or token generation, or regulated lottery draws — should follow the independent procedure your organization requires rather than relying on a browser tab. When in doubt, treat the random output from any of these methods as convenient input to a larger process, not as the final authority, and pair the generator with whatever verification step the situation calls for.