REFERENCE
U.RAND
Summary
Returns a random number, either between 0 and 1 or between a specified high and low. Non-volatile alternative to Excel's native RAND, RANDBETWEEN and RANDARRAY functions
Syntax
Parameters
| Parameter | Required | Description |
|---|---|---|
[low] |
No | The lowest number to be returned. If an integer is provided and high is either not provided or also an integer, then the random value generated will be an integer. If not set and high is set, then random number is unbounded on the low end |
[high] |
No | The highest number to be returned. If an integer is provided and low is either not provided or also an integer, then the random value generated will be an integer. If not set and low is set, then random number is unbounded on the high end |
[array] |
No | If set to TRUE then an array the size of the calling range is returned. If set to an integer, a column vector of random values with that many rows will be returned. If set to a row with 2 integers, they will set the number of rows and columns in the returned array. If set to a range, topic or cache key the result will be the size of that data |
Behavior
The documented public interface is supported by the current U Add-in source signature and the maintained Usage Examples workbook. Optional parameters are shown in square brackets in the syntax above; omit the brackets when entering a formula.
Return Value
Returns the function result or action status described by the formula and parameters above. The maintained sources do not define a narrower, stable return contract for this function.
Examples
Notes
- Formula examples are preserved from maintained workbook usage and normalized to the current
U.prefix. - Complete formulas demonstrate working patterns; they do not imply that undocumented option values are supported.
- Where maintained sources do not specify every accepted value, default, or error message, this page does not infer one.
- For functions that perform actions, use a visible trigger or supported block/throttle parameter to avoid unintended repetition during recalculation.
Related
- Concept: Live Data and RTD Updates
- Concept: Caching and Throttling
- How-to: Throttle Updates
- Example: Throttled Live Dashboard