+ Reply to Thread
Results 1 to 6 of 6

function for random but not a given number

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    portsmouth,england
    MS-Off Ver
    Excel 2007
    Posts
    21

    function for random but not a given number

    Hello All,

    this may be quite hard to explain and I'm not sure if this function exists, but, is there a way to have a random number that is not 6? (this is only an example, it wouldn't be 6).

    Thank you in advance.
    Uduyt

  2. #2
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: function for random but not a given number

    You could have it recalculate the random number until the value is not 6.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  3. #3
    Registered User
    Join Date
    04-25-2012
    Location
    portsmouth,england
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: function for random but not a given number

    Yes that's what I had in mind if the function didn't exist but thanks anyway!

  4. #4
    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: function for random but not a given number

    0 to 9 but not 6:

    =MOD(RANDBETWEEN(6+1, 6+9), 10)
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: function for random but not a given number

    nice shg, cool

  6. #6
    Registered User
    Join Date
    04-25-2012
    Location
    portsmouth,england
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: function for random but not a given number

    cheers man you solved it

+ 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