Random Numbers???

  • Thread starter Thread starter Crackles McFarly
  • Start date Start date
C

Crackles McFarly

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....
 
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.
 
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
 
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?
 
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).
 

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

Back
Top