Using "=randbetween" to select a number from a range of cells

A

a0xbjzz

I've just begun using =randbetween, bear with me!

I am trying to come up with a random number from a set of about 100 cells.
The only numbers available in those 100 cells are 0 thru 4.

Do I set my function to choose a random number between 0 and 4
(=randbetween(0,4)) or do I set it to pick a random number from the range of
cells (=randbetween(A1:A100))?

Is there going to be any difference in the data I come up with?
 
B

bj

(0,4)
the (A1:A100)
would use the limits between whateverl values were in A1 and in A100
 
T

T. Valko

Do I set my function to choose a random number between 0 and 4
(=randbetween(0,4)) or do I set it to pick a random number from the range
of
cells (=randbetween(A1:A100))?

You could do either but the range of cells should be just 2 cells that hold
the boundaries:

=RANDBETWEEN(0,4)

Or:

B1: =MIN(A1:A100)
C1: =MAX(A1:A100)

Then:

=RANDBETWEEN(B1,C1)

Or, you can put that all in the formula:

=RANDBETWEEN(MIN(A1:A100),MAX(A1:A100))
 
D

Dana DeLouis

I am trying to come up with a random number from a set of about 100 cells.
The only numbers available in those 100 cells are 0 thru 4.

HI. I think it depends on what you are doing. You didn't mention the
distribution of the numbers.
For example, if you only had 1-zero, 1-one, 1-two, 1-three, and 96 4's, then
using =RANDBETWEEN(0,4) would give equal weight to each number. Depending
on what you are doing, that may not be what you want.

Another option might be to give a percentage weight to the number of each
value. For example, if zero occured half the time, then using =RAND() might
be an option. If value if <=0.5, then pick 0, ...etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top