## Excel: Generating a Random Number Between Two ValuesLast reviewed: November 2, 1994 |

## SUMMARYRAND() generates a new random number between 0 and 1 (exclusive) every time the sheet is recalculated. To generate a random decimal number between two given values, use RAND() in the following formula: =(endnum-beginnum)*RAND()+beginnum To generate a random integer between two given integers, include the above formula in an INT() statement, as follows =INT((endnum-beginnum+1)*RAND())+beginnum where beginnum is the smallest and endnum is the largest random numbers you want returned. Note that for generating numbers between 0 (zero) and a given number, the formulas simplify to the following: =endnum*RAND() For decimal numbers between zero and endnum =INT((endnum+1)*RAND()) For integers between zero and endnum |

KBCategory: kbother Last reviewed: November 2, 1994 |