+ Reply to Thread
Results 1 to 11 of 11

Create random number from 3-10

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Create random number from 3-10

    I have a formula to generate a random number between 0 and 10.
    Please Login or Register  to view this content.
    .
    I only need a number between 3 and 10 and can't figure out how to modify the formula for this. Any help to modify code is appreciated. Thanks.
    Last edited by maacmaac; 05-05-2009 at 11:07 AM.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Create random number from 3-10

    Hi,

    Use RANDBETWEEN

    =RANDBETWEEN(3,10)
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Create random number from 3-10

    =INT(8*RAND()) + 3

    Or =RANDBETWEEN(3,10) with the Analysis Toolpak.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Create random number from 3-10

    =round((rand() *7 + 3),2)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Create random number from 3-10

    Don't think so, Special-K.

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Create random number from 3-10

    =RANDBETWEEN(3,10)
    Don't think so shg

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Create random number from 3-10

    Pardon, OC?

  8. #8
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Create random number from 3-10

    Sorry mate, I was sure I read that as

    =RANDBETWEEN(3,1)

    Need to change eyes

  9. #9
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: Create random number from 3-10

    Didn't expect so many solutions but much appreciated. Good to know for future reference.

    I ended up using =INT(8*RAND()) + 3 and/or =round((rand() *7 + 3),2) . Could not use the Randbetween function as my company is still using Office 2000.

    Thanks for comments.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Create random number from 3-10

    If you use ROUND, the end-point numbers will occur with half the likelihood of the interior numbers.

    To see a quick example, copy =ROUND(3 * RAND(), 0) down 600 rows. On average, you'll see 100 0's, 200 1's, 200 2's, and 100 3's.

  11. #11
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: Create random number from 3-10

    Good point. Thanks for the tip...another one I can file away for future reference.

+ 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