- SpreadJS Overview
- Getting Started
- JavaScript Frameworks
- Best Practices
- Features
- SpreadJS Designer
- SpreadJS Designer Component
- SpreadJS Collaboration Server
- Touch Support
-
Formula Reference
- Formula Overview
-
Formula Functions
- Barcode Functions
- Compatibility Functions
- Database Functions
- Date and Time Functions
- Engineering Functions
- Financial Functions
- Information Functions
- Logical Functions
- Lookup and Reference Functions
-
Math and Trigonometric Functions
- ABS
- ACOS
- ACOSH
- ACOT
- ACOTH
- AGGREGATE
- ARABIC
- ASIN
- ASINH
- ATAN
- ATAN2
- ATANH
- BASE
- CEILING
- CEILING.MATH
- CEILING.PRECISE
- COMBIN
- COMBINA
- COS
- COSH
- COT
- COTH
- CSC
- CSCH
- DECIMAL
- DEGREES
- EVEN
- EXACT
- EXP
- FACT
- FACTDOUBLE
- FLOOR.MATH
- FLOOR.PRECISE
- GCD
- INT
- ISO.CEILING
- LCM
- LET
- LN
- LOG
- LOG10
- MDETERM
- MINVERSE
- MMULT
- MOD
- MROUND
- MULTINOMIAL
- MUNIT
- ODD
- PI
- POWER
- PRODUCT
- QUOTIENT
- RADIANS
- RAND
- RANDARRAY
- RANDBETWEEN
- ROMAN
- ROUND
- ROUNDDOWN
- ROUNDUP
- SEC
- SECH
- SEQUENCE
- SERIESSUM
- SIGN
- SIN
- SINH
- SQRT
- SQRTPI
- SUBTOTAL
- SUM
- SUMIF
- SUMIFS
- SUMPRODUCT
- SUMSQ
- SUMX2MY2
- SUMX2PY2
- SUMXMY2
- TAN
- TANH
- TRUNC
- Statistical Functions
- Sparkline Functions
- Text Functions
- Web Functions
- RegEx Functions
- Other Functions
- Import and Export Reference
- Frequently Used Events
- API Documentation
- Release Notes
(Showing Draft Content)
RAND
This function returns an evenly distributed random number between 0 and 1.
Syntax
RAND()
Arguments
This function does not accept arguments.
Remarks
This function returns a new random number.
To generate a random real number between x and y, with y greater than x, use the following expression:
RAND()*(y-x)+x
To generate a random integer between x and y, with y greater than x, use the following expression:
INT((y-x+1)*RAND()+x)
For more information, refer to Volatile Functions.
Data Types
Does not accept data. Returns numeric data.
Examples
RAND()
RAND()*100
INT(RAND()*100)