PC Review


Reply
Thread Tools Rate Thread

combine Rand & Roundup?

 
 
=?Utf-8?B?QnJhaW5sZXNzX2luX0Jvc3Rvbg==?=
Guest
Posts: n/a
 
      5th May 2006
I am playing with numbers today.

I set a1:a100 with whole numbers 1 to 100. Then for b1:b100 entered =RAND()

However, instead of whole integers, I got decimals, like: 0.3356457

when I installed the right add in, Analysis ToolPak and used this formula:

=RANDBETWEEN(1,100), I got whole integers .

Anyone know why the =RAND() derived decimals? is there a way to have whole
integers generated using rand & roundup in b1:b100?

Inquiring minds wnat to knwo.

Thanks for all your help. This is a great forum.

(too bad MS doesn't have better help online!)

Mark
Boston
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U1ZD?=
Guest
Posts: n/a
 
      5th May 2006
RAND() generates a random number between 0 and 1 (see Excel Help description
of RAND)

To generate an integer rounded up and between 0 and 100, try
=ROUNDUP(RAND()*100,0)

"Brainless_in_Boston" wrote:

> I am playing with numbers today.
>
> I set a1:a100 with whole numbers 1 to 100. Then for b1:b100 entered =RAND()
>
> However, instead of whole integers, I got decimals, like: 0.3356457
>
> when I installed the right add in, Analysis ToolPak and used this formula:
>
> =RANDBETWEEN(1,100), I got whole integers .
>
> Anyone know why the =RAND() derived decimals? is there a way to have whole
> integers generated using rand & roundup in b1:b100?
>
> Inquiring minds wnat to knwo.
>
> Thanks for all your help. This is a great forum.
>
> (too bad MS doesn't have better help online!)
>
> Mark
> Boston

 
Reply With Quote
 
=?Utf-8?B?QnJhaW5sZXNzX2luX0Jvc3Rvbg==?=
Guest
Posts: n/a
 
      5th May 2006
SVC -

You are the coolest, baby!

Great formula. Thanks for posting it. Very clean and efective.

You are also right to suggest MS Help for RAND. It only generates a random
number >0 and <1 when you use =RAND()

=RAND()*100 generates a number like 95.451267

veddy interesting.

Anyone know how to use Excel to calculate pi to 50 decimals?

Mark
Boston

=========================================

"SVC" wrote:

> RAND() generates a random number between 0 and 1 (see Excel Help description
> of RAND)
>
> To generate an integer rounded up and between 0 and 100, try
> =ROUNDUP(RAND()*100,0)
>
>

==========================
"Brainless_in_Boston" wrote:
>
> > I am playing with numbers today.
> >
> > I set a1:a100 with whole numbers 1 to 100. Then for b1:b100 entered =RAND()
> >
> > However, instead of whole integers, I got decimals, like: 0.3356457
> >
> > when I installed the right add in, Analysis ToolPak and used this formula:
> >
> > =RANDBETWEEN(1,100), I got whole integers.
> >
> > Anyone know why the =RAND() derived decimals? is there a way to have whole
> > integers generated using rand & roundup in b1:b100?
> >
> > Inquiring minds want to know.
> >
> > Thanks for all your help. This is a great forum.
> >
> > (too bad MS doesn't have better help online!)
> >
> > Mark
> > Boston

 
Reply With Quote
 
David J. Braden
Guest
Posts: n/a
 
      10th May 2006
You're biasing the integers upward; better to use
=INT(RAND()*100+1

HTH
Dave Braden

Brainless_in_Boston wrote:
> SVC -
>
> You are the coolest, baby!
>
> Great formula. Thanks for posting it. Very clean and efective.
>
> You are also right to suggest MS Help for RAND. It only generates a random
> number >0 and <1 when you use =RAND()
>
> =RAND()*100 generates a number like 95.451267
>
> veddy interesting.
>
> Anyone know how to use Excel to calculate pi to 50 decimals?
>
> Mark
> Boston
>
> =========================================
>
> "SVC" wrote:
>
>> RAND() generates a random number between 0 and 1 (see Excel Help description
>> of RAND)
>>
>> To generate an integer rounded up and between 0 and 100, try
>> =ROUNDUP(RAND()*100,0)
>>
>>

> ==========================
> "Brainless_in_Boston" wrote:
>>> I am playing with numbers today.
>>>
>>> I set a1:a100 with whole numbers 1 to 100. Then for b1:b100 entered =RAND()
>>>
>>> However, instead of whole integers, I got decimals, like: 0.3356457
>>>
>>> when I installed the right add in, Analysis ToolPak and used this formula:
>>>
>>> =RANDBETWEEN(1,100), I got whole integers.
>>>
>>> Anyone know why the =RAND() derived decimals? is there a way to have whole
>>> integers generated using rand & roundup in b1:b100?
>>>
>>> Inquiring minds want to know.
>>>
>>> Thanks for all your help. This is a great forum.
>>>
>>> (too bad MS doesn't have better help online!)
>>>
>>> Mark
>>> Boston


--
Please keep response(s) solely within this thread.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Roundup and rounddown function - how to combine Stefi Microsoft Excel Worksheet Functions 0 28th May 2010 09:11 AM
RE: Roundup and rounddown function - how to combine RonaldoOneNil Microsoft Excel Worksheet Functions 0 28th May 2010 08:57 AM
how can i set up rand or rand between to give only -1 or 1? =?Utf-8?B?VWVzaWV0?= Microsoft Excel Worksheet Functions 8 27th Oct 2008 02:28 PM
RoundUp Function not giving same answer as Excel RoundUp =?Utf-8?B?RGVuaXNl?= Microsoft Access VBA Modules 2 3rd Jun 2007 11:32 PM
Replace =RAND() with =ABS(RAND()) =?Utf-8?B?RG9u?= Microsoft Excel Worksheet Functions 24 11th Dec 2003 08:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 PM.