+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] combine Rand & Roundup?

  1. #1
    Brainless_in_Boston
    Guest

    [SOLVED] combine Rand & Roundup?

    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

  2. #2
    SVC
    Guest

    RE: combine Rand & Roundup?

    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


  3. #3
    Brainless_in_Boston
    Guest

    RE: combine Rand & Roundup?

    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


  4. #4
    David J. Braden
    Guest

    Re: combine Rand & Roundup?

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1