Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
sara
 
Posts: n/a
Default Help on Random Numbers

Hi.
It would help to know how I could
Fill up random numbers in say Cell A1 to E1
but the total of the random numbers should add up to say number 100
please help.
  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi

one option is in cells
A1:D1 use the formula
=RANDBETWEEN(1,20)
and in E1 use the formula
=100-SUM(A1:D1)

Cheers
JulieD

"sara" wrote in message
...
Hi.
It would help to know how I could
Fill up random numbers in say Cell A1 to E1
but the total of the random numbers should add up to say number 100
please help.



  #3   Report Post  
sara
 
Posts: n/a
Default

Hi JuliD
tried that. works fine. but sometimes cell E1 displays number that is too
large
from the rest of the cells. This is because the total is subtracted from 100.
I would prefer "evenly" distributed numbers. Are there any formulars to do
that ?

"JulieD" wrote:

Hi

one option is in cells
A1:D1 use the formula
=RANDBETWEEN(1,20)
and in E1 use the formula
=100-SUM(A1:D1)

Cheers
JulieD

"sara" wrote in message
...
Hi.
It would help to know how I could
Fill up random numbers in say Cell A1 to E1
but the total of the random numbers should add up to say number 100
please help.




  #4   Report Post  
JulieD
 
Posts: n/a
Default

Hi Sara

not aware of any way of achieving this - even using code it would be
difficult as you'ld have to "loop" it until you found an "evenly
distributed" series of numbers and then one would question the concept of
"random", especially as you're only taking about 5 numbers!

sorry

Cheers
JulieD



"sara" wrote in message
...
Hi JuliD
tried that. works fine. but sometimes cell E1 displays number that is too
large
from the rest of the cells. This is because the total is subtracted from
100.
I would prefer "evenly" distributed numbers. Are there any formulars to
do
that ?

"JulieD" wrote:

Hi

one option is in cells
A1:D1 use the formula
=RANDBETWEEN(1,20)
and in E1 use the formula
=100-SUM(A1:D1)

Cheers
JulieD

"sara" wrote in message
...
Hi.
It would help to know how I could
Fill up random numbers in say Cell A1 to E1
but the total of the random numbers should add up to say number 100
please help.






  #5   Report Post  
Sukhjeet
 
Posts: n/a
Default

Hi Sara
You could do this:
In A1 to E1, type formula =rand().
In A2 to E2 type =A1*100/SUM($A$1:$E$1) (where 100 is the sum of all the
random numbers you require)
This will give you the numbers whose some equals 100.


"sara" wrote:

Hi JuliD
tried that. works fine. but sometimes cell E1 displays number that is too
large
from the rest of the cells. This is because the total is subtracted from 100.
I would prefer "evenly" distributed numbers. Are there any formulars to do
that ?

"JulieD" wrote:

Hi

one option is in cells
A1:D1 use the formula
=RANDBETWEEN(1,20)
and in E1 use the formula
=100-SUM(A1:D1)

Cheers
JulieD

"sara" wrote in message
...
Hi.
It would help to know how I could
Fill up random numbers in say Cell A1 to E1
but the total of the random numbers should add up to say number 100
please help.






  #6   Report Post  
Bill Sharpe
 
Posts: n/a
Default

If the numbers must add to 100 the last number is not really random
because there's a constraint involved. Of course the RAND function
really gives you pseudo-random numbers anyway, good enough for most
practical purposes.

You can avoid getting a large number as the fifth number by changing the
upper limit of RANDBETWEEN to a number higher than 20. Using 20 as the
upper limit guarantees that the fifth number will always be 20 or
greater. Don't go too high or the fifth number will be too small
compared to the others. You'll have to experiment a bit.

Bill

"sara" wrote in message
...
Hi JuliD
tried that. works fine. but sometimes cell E1 displays number that is
too
large
from the rest of the cells. This is because the total is subtracted from
100.
I would prefer "evenly" distributed numbers. Are there any formulars to
do
that ?

"JulieD" wrote:

Hi

one option is in cells
A1:D1 use the formula
=RANDBETWEEN(1,20)
and in E1 use the formula
=100-SUM(A1:D1)

Cheers
JulieD

"sara" wrote in message
...
Hi.
It would help to know how I could
Fill up random numbers in say Cell A1 to E1
but the total of the random numbers should add up to say number 100
please help.






  #7   Report Post  
Sukhjeet
 
Posts: n/a
Default

Hi Bill
The method I proposed, of generating five random numbers, multiplying each
with the total required (100 in this case) and then dividing with the sum of
those five random numbers will result in a better randomisation than
generating 4 random numbers (between 1 and 20) and subtracting their sum from
100.
Ciao
Sukhjeet

"Bill Sharpe" wrote:

If the numbers must add to 100 the last number is not really random
because there's a constraint involved. Of course the RAND function
really gives you pseudo-random numbers anyway, good enough for most
practical purposes.

You can avoid getting a large number as the fifth number by changing the
upper limit of RANDBETWEEN to a number higher than 20. Using 20 as the
upper limit guarantees that the fifth number will always be 20 or
greater. Don't go too high or the fifth number will be too small
compared to the others. You'll have to experiment a bit.

Bill

"sara" wrote in message
...
Hi JuliD
tried that. works fine. but sometimes cell E1 displays number that is
too
large
from the rest of the cells. This is because the total is subtracted from
100.
I would prefer "evenly" distributed numbers. Are there any formulars to
do
that ?

"JulieD" wrote:

Hi

one option is in cells
A1:D1 use the formula
=RANDBETWEEN(1,20)
and in E1 use the formula
=100-SUM(A1:D1)

Cheers
JulieD

"sara" wrote in message
...
Hi.
It would help to know how I could
Fill up random numbers in say Cell A1 to E1
but the total of the random numbers should add up to say number 100
please help.







  #8   Report Post  
sara
 
Posts: n/a
Default

Hi Guys,
Thanks for the brilliant suggestions. I prefer Sukhjeet's method as JulieD
suggestion; at random produces negative number on the last cell and also
random numbers appear procedural in the first 4 cells but not in the last
one(i.e if at random A1 to D1 produces nos 1,4,6,6.then the last one produces
100-1-4-6-6.this is a huge different) I am just afraid if this random row
might go unnoticed. Thanks guys. And by the way I know F9 randoms the entire
spreadsheet but how do I random just one row out of the hundreds?



"Sukhjeet" wrote:

Hi Bill
The method I proposed, of generating five random numbers, multiplying each
with the total required (100 in this case) and then dividing with the sum of
those five random numbers will result in a better randomisation than
generating 4 random numbers (between 1 and 20) and subtracting their sum from
100.
Ciao
Sukhjeet

"Bill Sharpe" wrote:

If the numbers must add to 100 the last number is not really random
because there's a constraint involved. Of course the RAND function
really gives you pseudo-random numbers anyway, good enough for most
practical purposes.

You can avoid getting a large number as the fifth number by changing the
upper limit of RANDBETWEEN to a number higher than 20. Using 20 as the
upper limit guarantees that the fifth number will always be 20 or
greater. Don't go too high or the fifth number will be too small
compared to the others. You'll have to experiment a bit.

Bill

"sara" wrote in message
...
Hi JuliD
tried that. works fine. but sometimes cell E1 displays number that is
too
large
from the rest of the cells. This is because the total is subtracted from
100.
I would prefer "evenly" distributed numbers. Are there any formulars to
do
that ?

"JulieD" wrote:

Hi

one option is in cells
A1:D1 use the formula
=RANDBETWEEN(1,20)
and in E1 use the formula
=100-SUM(A1:D1)

Cheers
JulieD

"sara" wrote in message
...
Hi.
It would help to know how I could
Fill up random numbers in say Cell A1 to E1
but the total of the random numbers should add up to say number 100
please help.






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
Generate random numbers 1-100 without any repeats? ExcelFan Excel Worksheet Functions 4 May 5th 23 07:46 PM
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
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
generate random numbers Jules Excel Worksheet Functions 6 November 2nd 04 05:57 PM


All times are GMT +1. The time now is 01:50 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"