Working with Worksheet Functions

Close Window 

Generating Random Numbers

Use Excel's RAND() worksheet function to generate random numbers. Here's how:

  1. Select a cell or range into which you want to enter a random numbers.

  2. To enter random numbers between 0 and 10, type =RAND()*10; to enter random numbers between 0 and 100, type =RAND()*100 (quick now, what do you type to get numbers between 0 and 1000? Uh-huh). Press Enter to enter the formula into a single cell or Ctrl-Enter to enter it into a range.

  3. Right click the selection and select Format Cells from the shortcut menu.

  4. Click the Number tab.

  5. In the Category box, select a category, then select the number of decimal places you need (if necessary).

  6. Click OK.

Note that numbers generated by RAND() change every time you recalculate your worksheet. Use Paste Special to paste them into their cells as values if you donít want them to change.

(Posted 07/09/2000)