Microsoft Knowledge Base |
|
How to Automatically Return a Random Value from a List |
|
|
Last reviewed: May 29, 1997
Article ID: Q169169 |
|
The information in this article applies to:
SUMMARYBy using a combination of the INDEX, INT, ROWS, and RAND functions in a worksheet formula in Microsoft Excel, you can automatically return a random value from a list on a worksheet.
MORE INFORMATIONThe following example formula automatically returns a random value from a list on a worksheet
=INDEX(<Range>,INT(ROWS(Range)*RAND())-1,1)where <Range> is the address of the cells that contain the data. To use the formula, do the following:
ARTICLE-ID: Q44738 TITLE : Generating a Random Number without RAND() in Excel ARTICLE-ID: Q96746 TITLE : XL: Using RAND() to Generate Randomly Distributed Integers |
|
Keywords : kbusage xlformula
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |