Category: FUNCTION | Updated: 2026-11-22
How to Use the RANDARRAY Function in Google Sheets
Syntax
=RANDARRAY([rows], [columns])
- rows (Optional): The number of rows of random numbers to generate. Defaults to
1if omitted. - columns (Optional): The number of columns of random numbers to generate. Defaults to
1if omitted.
Example
Entering =RANDARRAY(3, 2) in cell A1 generates random numbers greater than or equal to 0 and less than 1 across a 3-row by 2-column range.
| Column A | Column B | |
|---|---|---|
| Row 1 | 0.4829104 | 0.9102834 |
| Row 2 | 0.1293847 | 0.6543219 |
| Row 3 | 0.8374651 | 0.0492817 |
Note: Values change on every recalculation.
Common Errors and Notes
- Difference from Excel: Excel’s
RANDARRAYfunction includes arguments for min, max, and whole-number mode, whereas Google Sheets’RANDARRAYfunction only accepts two arguments:rowsandcolumns. - #REF! Error: An error occurs if any cell in the range where the array spills already contains a value.
Frequently Asked Questions
Q. How do I generate random integers with RANDARRAY?
A. Because RANDARRAY itself returns decimals between 0 and 1, combine it with INT or ROUND, such as "=ARRAYFORMULA(INT(RANDARRAY(3, 2)*100))".
Q. Is there a way to prevent generated random numbers from changing automatically?
A. Because the function recalculates whenever the sheet is edited, copy the cells and use Paste special > Values only if you want to lock the values.