RANDARRAY Function in Google Sheets: Formula, Examples & Troubleshooting
Generate a random grid in Google Sheets with RANDARRAY. Set rows and columns, scale scenario inputs, freeze a draw, and avoid Excel-only arguments.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =RANDARRAY(4,2) produces a grid of four rows and two columns containing random numbers between 0 and 1. You can predict the grid’s dimensions, but not its exact values.
Verification: NOT_TESTED_IN_GOOGLE_SHEETS. First-party documentation was reviewed October 17, 2026. The fixed sample below is illustrative; its arithmetic was independently checked. It is not a captured Sheets draw.
Syntax and dimensions
=RANDARRAY(rows, columns)
Google marks both arguments optional, although its displayed syntax does not use square brackets. If you supply columns, also supply rows. With neither argument, =RANDARRAY() returns one value in a 1-by-1 grid. The examples here give both dimensions explicitly rather than relying on an unstated single-argument default. Google RANDARRAY documentation.
Use positive whole-number dimensions for the layouts in this guide. The reference does not establish the treatment of zero, fractional, or negative dimensions, or their exact error messages. It describes the output as between 0 and 1; it does not separately specify endpoint inclusion for RANDARRAY. Do not infer a reproducible sequence or seed argument from that description.
Example: four delivery-cost scenarios
Set A1 to Scenario, B1 to Draw, and C1 to Cost. Enter Base, Busy, Late, and Remote in A2:A5.
- Leave B2:B5 clear.
- Put
=RANDARRAY(4,1)in B2. Its four-row output belongs in B2:B5. - Put
=18+4*B2in C2 and fill down to C5. - Format C2:C5 as currency with two decimal places.
The arithmetic maps the unit-scale draw onto an 18-to-22 cost scale. Here is one hypothetical set of draws, chosen by hand solely to explain the calculation:
| Scenario | Illustrative draw | Independently calculated cost |
|---|---|---|
| Base | 0.10 | 18.40 |
| Busy | 0.35 | 19.40 |
| Late | 0.70 | 20.80 |
| Remote | 0.95 | 21.80 |
For the first row, 18 + 4 × 0.10 = 18.40. Actual RANDARRAY values will differ. A screenshot or table with these exact numbers would not establish a live test.
Keep the same draw cell when comparing two cost formulas. For example, D2 could contain =17+6*B2. At the illustrative draw 0.35, the two costs are 19.40 and 19.10. Using two separately generated grids would change both the model and the sampled inputs, making that comparison harder to interpret.
Advanced use: a reusable two-variable scenario grid
Place =RANDARRAY(4,2) in F2 with F2:G5 reserved for its output. Treat F as a demand factor and G as a separate input for a delivery surcharge. In H2, use =80+40*F2; in I2, use =2+3*G2, then fill both formulas down four rows.
For an illustrative pair F2 = 0.25 and G2 = 0.80, the outputs are 90 and 4.40. Label those columns with their modeled units. Random decimals acquire meaning only through an explicit model; the function itself does not supply a business forecast, correlation structure, or evidence that the chosen ranges fit real data.
For an auditable scenario, copy the resulting draw grid and use Edit → Paste special → Values only into a separate area of the same spreadsheet. This retains a fixed realization for later comparisons. Keep the generating formula separately if you still need new draws. Google’s paste-special instructions and volatile-function guidance explain the distinction between formulas and static values.
Troubleshooting
- The numbers changed: Google says pressing Enter updates RANDARRAY results. A formula-driven draw is not a permanent record; save values when a particular scenario must remain stable.
- The output has the wrong shape: Arguments are rows first, columns second. A 4-by-2 grid has eight cells, not six.
- There is no room for the grid: Reserve the output rectangle. Array results extend into neighboring cells; inspect those cells before placing a large result over existing work.
- An import formula rejects the random result: Google’s import-function reference explicitly lists RANDARRAY among volatile dependencies that can trigger an import error. Supply a static saved value when that is appropriate.
- You need bounded integers: Sheets’ RANDARRAY signature has no integer-mode argument. Do not paste Excel’s extended argument list into it.
Google Sheets versus Excel, and availability
Microsoft documents RANDARRAY([rows],[columns],[min],[max],[whole_number]) in Excel. Google documents only rows and columns. That is a verified signature difference; it does not establish any identical random-number algorithm between the products.
Google’s current reference establishes documented availability as of the review date. The first introduction date and any last-working or retirement version were not established. Exact generated values, statistical independence, and native error tokens were not tested here.
Related guides and references
Use SEQUENCE for predictable numbered rows, ROUND for explicit decimal rounding, and AVERAGE to summarize a saved scenario sample.
First-party references reviewed October 17, 2026: RANDARRAY, array output, Google import volatility, paste special, and Microsoft RANDARRAY.