+ Reply to Thread
Results 1 to 4 of 4

Random Number Generator

  1. #1
    Registered User
    Join Date
    01-11-2017
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    8

    Random Number Generator

    I am trying to make a speadsheet that gives me random results for a list of items. I have 4 items in which two have sub categories. For instance, lets say that item 1 has 4 subs under it. I need a formula that states if Item 1 is randomly selected, then one of the 4 subs will be also randomly picked. Does anyone know how to do this?

    I have tried - =IF(G13=1,"=RANDBETWEEN(1,4)") but this only gives me "RANDBETWEEN(1,4)" as a result if 1 is generated. I would like it to go further and randomly select sub 1,2,3 or 4.

    Thanks for the help

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Random Number Generator

    Maybe you could create tables with your subs and then you can use the randbetween within a vlookup and generate your results.

    If you can mock up a sheet, with your expected results maybe we can figure out something.
    HTH
    Regards, Jeff

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,391

    Re: Random Number Generator

    Is that the exact formula string you are using? If so, the quotation marks tell Excel that you are intending this as a text string and not a function, so it returns the text "=RANDBETWEEN(1,4)". In order to get it to treat this as a function, drop the quotation marks and the equal sign. Something like =IF(G13=1,RANDBETWEEN(1,4))
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    01-11-2017
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    8

    Re: Random Number Generator

    Thanks MR Short, that worked!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 06-21-2013, 10:40 AM
  2. Random Number Generator Help
    By Tkurtz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-07-2013, 10:19 PM
  3. [SOLVED] random number generator
    By thusarix in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 11-29-2011, 02:19 PM
  4. [SOLVED] Random Number Generator help
    By Shani in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2006, 11:35 AM
  5. random number generator
    By manclad in forum Excel General
    Replies: 5
    Last Post: 12-31-2005, 07:10 AM
  6. Try Random Number Generator
    By dok112 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-18-2005, 02:10 AM

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