ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Random Numbers??? (https://www.excelbanter.com/excel-worksheet-functions/162219-random-numbers.html)

Crackles McFarly

Random Numbers???
 
I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....


JW[_2_]

Random Numbers???
 
=RANDBETWEEN(1,15)

Crackles McFarly wrote:
I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....



Crackles McFarly

Random Numbers???
 
On Mon, 15 Oct 2007 13:53:03 -0700, JW sayd
the following:

=RANDBETWEEN(1,15)


OMG r u serious?
LOL, thanks a lot.



Crackles McFarly

Random Numbers???
 
On Mon, 15 Oct 2007 13:53:03 -0700, JW sayd
the following:

=RANDBETWEEN(1,15)

Crackles McFarly wrote:
I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....




USING EXCEL 1997, that didn't work....?



David Biddulph[_2_]

Random Numbers???
 
It's worth remembering that if you look up an Excel function in Excel help,
there is usually a "See also" link to tell you about related or similar
functions.
--
David Biddulph

"Crackles McFarly" wrote in message
...
I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....




Crackles McFarly

Random Numbers???
 
On Mon, 15 Oct 2007 16:42:48 -0400, Crackles McFarly
sayd the following:

I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....



=ROUNDDOWN(RAND()*(50-1)+1,0)

SO THAT IT ROUNDS TO NEAREST WHOLE NUMBER?????

Is this correct???

I've tested and never see a 1 or 50 though?????

thnks


David Biddulph[_2_]

Random Numbers???
 
By "didn't work", do you mean that you got the error #NAME?
And did you look up RANDBETWEEN in Excel help to see what to do to make the
function work?
--
David Biddulph

"Crackles McFarly" wrote in message
...

USING EXCEL 1997, that didn't work....?

On Mon, 15 Oct 2007 13:53:03 -0700, JW sayd
the following:

=RANDBETWEEN(1,15)

Crackles McFarly wrote:
I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....




T. Valko

Random Numbers???
 
If you want a random number between 1 and 50 (inclusive):

=INT(1+50*RAND())

--
Biff
Microsoft Excel MVP


"Crackles McFarly" wrote in message
...
On Mon, 15 Oct 2007 16:42:48 -0400, Crackles McFarly
sayd the following:

I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....



=ROUNDDOWN(RAND()*(50-1)+1,0)

SO THAT IT ROUNDS TO NEAREST WHOLE NUMBER?????

Is this correct???

I've tested and never see a 1 or 50 though?????

thnks




David Biddulph[_2_]

Random Numbers???
 
Does ROUNDDOWN sound as if it rounds to the *nearest* whole number, or does
it sound as if it might always round *down*? [Again Help will help.]

I wouldn't expect a 50 from that formula, but I do expect (and get) a 1. If
you want a 50 too, then ditch the -1 from the formula, or use
=RANDBETWEEN (1,50).
--
David Biddulph

"Crackles McFarly" wrote in message
...

=ROUNDDOWN(RAND()*(50-1)+1,0)

SO THAT IT ROUNDS TO NEAREST WHOLE NUMBER?????

Is this correct???

I've tested and never see a 1 or 50 though?????

thnks

On Mon, 15 Oct 2007 16:42:48 -0400, Crackles McFarly
sayd the following:

I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....




T. Valko

Random Numbers???
 
Here' a generic formula:

=INT(lower_boundary+(upper_boundary-lower_boundary+1)*RAND())

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
If you want a random number between 1 and 50 (inclusive):

=INT(1+50*RAND())

--
Biff
Microsoft Excel MVP


"Crackles McFarly" wrote in message
...
On Mon, 15 Oct 2007 16:42:48 -0400, Crackles McFarly
sayd the following:

I know the 'rand()' generates a random number.
Here comes a dumb question.

I need one from exactly 1 to X, how do you do this?


thanks....



=ROUNDDOWN(RAND()*(50-1)+1,0)

SO THAT IT ROUNDS TO NEAREST WHOLE NUMBER?????

Is this correct???

I've tested and never see a 1 or 50 though?????

thnks






Crackles McFarly

Random Numbers???
 
On Mon, 15 Oct 2007 17:22:12 -0400, "T. Valko"
sayd the following:

If you want a random number between 1 and 50 (inclusive):

=INT(1+50*RAND())



that worked great, thanks!

T. Valko

Random Numbers???
 
"Crackles McFarly" wrote in message
...
On Mon, 15 Oct 2007 17:22:12 -0400, "T. Valko"
sayd the following:

If you want a random number between 1 and 50 (inclusive):

=INT(1+50*RAND())



that worked great, thanks!


You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP




All times are GMT +1. The time now is 06:25 PM.

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