Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default random number generator

Hey is there a way to generate random numbers like you would for a
draft. In other words, i have numbers 1 through 10 and generate a
random order for those?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default random number generator

Use the RAND() function. If 1-10 are in A1:A10, enter =RAND() in cell B1 and
copy it down through B10. Recalc (F9), then sort by column B.

Hope this helps,

Hutch

"pat67" wrote:

Hey is there a way to generate random numbers like you would for a
draft. In other words, i have numbers 1 through 10 and generate a
random order for those?
.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default random number generator

On May 3, 5:23*pm, Tom Hutchins
wrote:
Use the RAND() function. If 1-10 are in A1:A10, enter =RAND() in cell B1 and
copy it down through B10. Recalc (F9), then sort by column B.

Hope this helps,

Hutch



"pat67" wrote:
Hey is there a way to generate random numbers like you would for a
draft. In other words, i have numbers 1 through 10 and generate a
random order for those?
.- Hide quoted text -


- Show quoted text -



Rand() only generates between 0 and 1
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default random number generator

Pat,

If you used RANDBETWEEN(1,10) you would be likely to get repeated numbers in
your range. You asked for the numbers 1 through 10 to be sorted in a random
order, which is exactly what Hutch's solution does - RAND() is only used for
sorting the numbers, not producing them.



"pat67" wrote in message
...
On May 3, 5:23 pm, Tom Hutchins
wrote:
Use the RAND() function. If 1-10 are in A1:A10, enter =RAND() in cell B1
and
copy it down through B10. Recalc (F9), then sort by column B.

Hope this helps,

Hutch



"pat67" wrote:
Hey is there a way to generate random numbers like you would for a
draft. In other words, i have numbers 1 through 10 and generate a
random order for those?
.- Hide quoted text -


- Show quoted text -



Rand() only generates between 0 and 1

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default random number generator

On May 5, 4:24*pm, "Steve Dunn" wrote:
Pat,

If you used RANDBETWEEN(1,10) you would be likely to get repeated numbers in
your range. *You asked for the numbers 1 through 10 to be sorted in a random
order, which is exactly what Hutch's solution does - RAND() is only used for
sorting the numbers, not producing them.

"pat67" wrote in message

...
On May 3, 5:23 pm, Tom Hutchins





wrote:
Use the RAND() function. If 1-10 are in A1:A10, enter =RAND() in cell B1
and
copy it down through B10. Recalc (F9), then sort by column B.


Hope this helps,


Hutch


"pat67" wrote:
Hey is there a way to generate random numbers like you would for a
draft. In other words, i have numbers 1 through 10 and generate a
random order for those?
.- Hide quoted text -


- Show quoted text -


Rand() only generates between 0 and 1- Hide quoted text -

- Show quoted text -


I have tried randbetween. the problem is like you said i sometimes get
the same number twice. What i was looking for is different. I wanted
to know if there was a way for me to get a random list of numbers
between 1 and 10 like this

2
4
3
1
6
10
9
7
5
8

So is there a way to do that or not? maybe with code? I don't know

Thanks


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default random number generator

pat67 wrote:
On May 5, 4:24 pm, "Steve Dunn" wrote:
Pat,

If you used RANDBETWEEN(1,10) you would be likely to get repeated numbers in
your range. You asked for the numbers 1 through 10 to be sorted in a random
order, which is exactly what Hutch's solution does - RAND() is only used for
sorting the numbers, not producing them.

"pat67" wrote in message

...
On May 3, 5:23 pm, Tom Hutchins





wrote:
Use the RAND() function. If 1-10 are in A1:A10, enter =RAND() in cell B1
and
copy it down through B10. Recalc (F9), then sort by column B.
Hope this helps,
Hutch
"pat67" wrote:
Hey is there a way to generate random numbers like you would for a
draft. In other words, i have numbers 1 through 10 and generate a
random order for those?
.- Hide quoted text -
- Show quoted text -

Rand() only generates between 0 and 1- Hide quoted text -

- Show quoted text -


I have tried randbetween. the problem is like you said i sometimes get
the same number twice. What i was looking for is different. I wanted
to know if there was a way for me to get a random list of numbers
between 1 and 10 like this

2
4
3
1
6
10
9
7
5
8

So is there a way to do that or not? maybe with code? I don't know

Thanks



Go back and read Tom's post again. Try it EXACTLY like he wrote it.
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default random number generator

If you're dead set against trying Hutch's solution, you could use a bit of
circular referencing to achieve this. First you will need to turn on
"Enable iterative calculation" from options - read up a bit on this so that
you understand all the implications.

Then in A1:

=RANDBETWEEN(1,10)

in A2:

=IF(($A2=0)+COUNTIF($A$1:$A1,$A2),RANDBETWEEN(1,10 ),$A2)

copied down A3:A10.

Hold Shift+F9 to generate a new sequence (this re-calculates the sheet). Be
aware that this will generate a new sequence whenever the sheet is
re-calculated, unless you fix the number in A1.




"pat67" wrote in message
...
On May 5, 4:24 pm, "Steve Dunn" wrote:
Pat,

If you used RANDBETWEEN(1,10) you would be likely to get repeated numbers
in
your range. You asked for the numbers 1 through 10 to be sorted in a
random
order, which is exactly what Hutch's solution does - RAND() is only used
for
sorting the numbers, not producing them.

"pat67" wrote in message

...
On May 3, 5:23 pm, Tom Hutchins





wrote:
Use the RAND() function. If 1-10 are in A1:A10, enter =RAND() in cell B1
and
copy it down through B10. Recalc (F9), then sort by column B.


Hope this helps,


Hutch


"pat67" wrote:
Hey is there a way to generate random numbers like you would for a
draft. In other words, i have numbers 1 through 10 and generate a
random order for those?
.- Hide quoted text -


- Show quoted text -


Rand() only generates between 0 and 1- Hide quoted text -

- Show quoted text -


I have tried randbetween. the problem is like you said i sometimes get
the same number twice. What i was looking for is different. I wanted
to know if there was a way for me to get a random list of numbers
between 1 and 10 like this

2
4
3
1
6
10
9
7
5
8

So is there a way to do that or not? maybe with code? I don't know

Thanks

  #8   Report Post  
Senior Member
 
Location: Hyderabad
Posts: 237
Thumbs up

Quote:
Originally Posted by pat67 View Post
Hey is there a way to generate random numbers like you would for a
draft. In other words, i have numbers 1 through 10 and generate a
random order for those?
in excel 2003:
=CEILING(RAND()*10,1)

in excel 2007 using RANDBETWEEN function
example: randbetween(1,10)


all the best
__________________
Thanks
Bala
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
Random number Generator RayT New Users to Excel 14 January 15th 08 11:16 PM
Random Number generator Neil M Excel Worksheet Functions 2 February 1st 06 06:00 PM
Random Number Generator STEVEB Excel Worksheet Functions 7 July 25th 05 11:41 PM
Random Number Generator Pascale Excel Worksheet Functions 3 July 9th 05 12:37 AM
Random number generator Philippe L. Balmanno Excel Worksheet Functions 4 December 17th 04 07:42 AM


All times are GMT +1. The time now is 05:01 AM.

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

About Us

"It's about Microsoft Excel"