ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   RAND() / RANDBETWEEN() FOR SPECIFIC ARRAY (https://www.excelbanter.com/excel-discussion-misc-queries/198205-rand-randbetween-specific-array.html)

FARAZ QURESHI

RAND() / RANDBETWEEN() FOR SPECIFIC ARRAY
 
How can one derive a random number from a specifc array, for example a random
selection from {2, 4, 16, 256, 65536}

--

Best Regards,
FARAZ A. QURESHI

Lars-Åke Aspelin[_2_]

RAND() / RANDBETWEEN() FOR SPECIFIC ARRAY
 
On Fri, 8 Aug 2008 23:38:00 -0700, FARAZ QURESHI
wrote:

How can one derive a random number from a specifc array, for example a random
selection from {2, 4, 16, 256, 65536}


Try this formula

=CHOOSE(RANDBETWEEN(1,5),2,4,16,256,65536)

Hope this helps / Lars-Åke

Teethless mama

RAND() / RANDBETWEEN() FOR SPECIFIC ARRAY
 
=INDEX({2,4,16,256,65536},RANDBETWEEN(1,5))


"FARAZ QURESHI" wrote:

How can one derive a random number from a specifc array, for example a random
selection from {2, 4, 16, 256, 65536}

--

Best Regards,
FARAZ A. QURESHI


Bernd P

RAND() / RANDBETWEEN() FOR SPECIFIC ARRAY
 
=2^(2^INT(RND()*5))

Regards,
Bernd

Sandy Mann

RAND() / RANDBETWEEN() FOR SPECIFIC ARRAY
 
"Bernd P" wrote in message
...
=2^(2^INT(RND()*5))


Clever, I like it!

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk



Mike Middleton

RAND() / RANDBETWEEN() FOR SPECIFIC ARRAY
 
FARAZ QURESHI -

What is the probability for each of the five distinct values?

Or, are the five values equally-likely?

- Mike Middleton
http://www.DecisionToolworks.com
Decision Analysis Add-ins for Excel



"FARAZ QURESHI" wrote in message
...
How can one derive a random number from a specifc array, for example a
random
selection from {2, 4, 16, 256, 65536}

--

Best Regards,
FARAZ A. QURESHI





All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com