Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default 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....

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 638
Default 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....


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default 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....?


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default 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....





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default 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....



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default 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....



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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







  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default 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!
  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting numbers divisible by 4 from random numbers in ascending order ramana Excel Worksheet Functions 6 June 19th 07 06:41 PM
How to select top six numbers from a of range of random numbers Jack M Taylor Excel Worksheet Functions 4 January 30th 07 09:18 PM
Can Excel pick random numbers from 1-300 and not repeat numbers? Julian Excel Discussion (Misc queries) 1 June 7th 06 07:17 AM
Non-random numbers generated by excel's data analysis random gener Allie Excel Worksheet Functions 10 September 17th 05 06:19 AM
Non-random numbers generated by excel's data analysis random gener Harlan Grove Excel Discussion (Misc queries) 2 September 13th 05 04:06 PM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"