Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
momma
 
Posts: n/a
Default Random numbers function

I am trying to make a sheet with random numbers in 100 cells from 0 to 99 and
not duplicate any number. Does anyone know what function I need to enter to
do this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default Random numbers function

http://www.tushar-mehta.com/excel/ne...ion/index.html

--
Kind regards,

Niek Otten

"momma" wrote in message
...
I am trying to make a sheet with random numbers in 100 cells from 0 to 99
and
not duplicate any number. Does anyone know what function I need to enter
to
do this?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
momma
 
Posts: n/a
Default Random numbers function



"momma" wrote:

I am trying to make a sheet with random numbers in 100 cells from 0 to 99 and
not duplicate any number. Does anyone know what function I need to enter to
do this?


Thanks for the info but I still can't seem to do what I want.

I might not have explained this properly. Let me try again. I have a range
of 10 rows by 10 columns. I want the computer to randomly enter the numbers
from 0 to 99 in each cell (one number per cell) without any duplication. I
am somewhat ignorant when it comes to entering formulas so the simplist way
would be great.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Random numbers function


Here's a way to do this with formulas - you need one helper column

To get your numbers 0-99 with no repeats in A1:J10

use this formula in L1 and copy down to L100
=RAND()

Put this formula in A1 and copy across to J1 and down all 10 columns to
row 10
=RANK(INDEX($L$1:$L$100,ROW()+10*(COLUMN()-1)),$L$1:$L$100)-1

hide column L if you wish

random numbers are regenerated every time sheet is recalculated (hit
F9)


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=508266

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ben-gr6teacher
 
Posts: n/a
Default Bias in Random Numbers

I've used =ROUND(RAND()*(6-1)+1,0) in 1000 cells to simulate rolling 1000
dice. This consistently has a bias toward generating 2, 3, 4, or 5 about 20%
(more than 16.6%) of the time and 1 or 6 only 10% of the time (less than
16.6%). When I used RANDBETWEEN(1,6) I do not have this problem.

Anyone know why?


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dana DeLouis
 
Posts: n/a
Default Bias in Random Numbers

Hi. I think that with the use of Round, numbers in the middle get a full
unit to work with.
Meaning that say 3.5-4.5 will round to 4.
However, the smallest number 0 occurs half as often... only with numbers
0-0.5. You need a whole range of say 0-1.
See if using Int will work.

=INT(RAND()*6)+1

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Ben-gr6teacher" wrote in message
...
I've used =ROUND(RAND()*(6-1)+1,0) in 1000 cells to simulate rolling 1000
dice. This consistently has a bias toward generating 2, 3, 4, or 5 about
20%
(more than 16.6%) of the time and 1 or 6 only 10% of the time (less than
16.6%). When I used RANDBETWEEN(1,6) I do not have this problem.

Anyone know why?



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vandenberg p
 
Posts: n/a
Default Bias in Random Numbers

Hello:

Think about it this way. Since Rand() produces random numbers between 0 and 1. The 6
outcomes can be calculated by using random numbers from 0 to .1666666666..... to represent
one, and all numbers from .166666666.... to .3333333333 to represent two etc. until
..83333333..... to 1.000000 to represent six. Your formula will result in .1 being
represented as a two and numbers less than .1 being one. Hence about 10% of numbers will be
one. This same process produces extra two, three, four and five. And again produces less
sixes, any random between number between .8333333 and .9000 will produce five rather than
6, again that would mean about 10% sixes, since the numbers between .83 and .90 do not
produce the required six.

Try this formula: =INT((6*RAND())+1) (this is from the Excel help file)

It will produce the results you want.

Pieter Vandenberg


Ben-gr6teacher wrote:
: I've used =ROUND(RAND()*(6-1)+1,0) in 1000 cells to simulate rolling 1000
: dice. This consistently has a bias toward generating 2, 3, 4, or 5 about 20%
: (more than 16.6%) of the time and 1 or 6 only 10% of the time (less than
: 16.6%). When I used RANDBETWEEN(1,6) I do not have this problem.

: Anyone know why?
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ben-gr6teacher
 
Posts: n/a
Default Bias in Random Numbers

THANK YOU, Dana!

"Dana DeLouis" wrote:

Hi. I think that with the use of Round, numbers in the middle get a full
unit to work with.
Meaning that say 3.5-4.5 will round to 4.
However, the smallest number 0 occurs half as often... only with numbers
0-0.5. You need a whole range of say 0-1.
See if using Int will work.

=INT(RAND()*6)+1

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Ben-gr6teacher" wrote in message
...
I've used =ROUND(RAND()*(6-1)+1,0) in 1000 cells to simulate rolling 1000
dice. This consistently has a bias toward generating 2, 3, 4, or 5 about
20%
(more than 16.6%) of the time and 1 or 6 only 10% of the time (less than
16.6%). When I used RANDBETWEEN(1,6) I do not have this problem.

Anyone know why?




  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ben-gr6teacher
 
Posts: n/a
Default Bias in Random Numbers

Thanks, Pieter!!!

"vandenberg p" wrote:

Hello:

Think about it this way. Since Rand() produces random numbers between 0 and 1. The 6
outcomes can be calculated by using random numbers from 0 to .1666666666..... to represent
one, and all numbers from .166666666.... to .3333333333 to represent two etc. until
..83333333..... to 1.000000 to represent six. Your formula will result in .1 being
represented as a two and numbers less than .1 being one. Hence about 10% of numbers will be
one. This same process produces extra two, three, four and five. And again produces less
sixes, any random between number between .8333333 and .9000 will produce five rather than
6, again that would mean about 10% sixes, since the numbers between .83 and .90 do not
produce the required six.

Try this formula: =INT((6*RAND())+1) (this is from the Excel help file)

It will produce the results you want.

Pieter Vandenberg


Ben-gr6teacher wrote:
: I've used =ROUND(RAND()*(6-1)+1,0) in 1000 cells to simulate rolling 1000
: dice. This consistently has a bias toward generating 2, 3, 4, or 5 about 20%
: (more than 16.6%) of the time and 1 or 6 only 10% of the time (less than
: 16.6%). When I used RANDBETWEEN(1,6) I do not have this problem.

: Anyone know why?

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 Numbers Boyce Coe Smith Excel Worksheet Functions 2 October 18th 05 05:29 PM
Generation of random numbers and sum of those with a condition ramana Excel Worksheet Functions 11 October 5th 05 05:01 AM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Validating random numbers plsauditor Excel Worksheet Functions 2 January 11th 05 11:12 PM
Random Numbers Change? Les Coover Excel Worksheet Functions 2 December 17th 04 02:49 AM


All times are GMT +1. The time now is 01:23 PM.

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"