+ Reply to Thread
Results 1 to 4 of 4

Want to generate random text from sheet in multiple cells

  1. #1
    Registered User
    Join Date
    11-14-2019
    Location
    Maryland
    MS-Off Ver
    Excel for MAC 16.3
    Posts
    12

    Want to generate random text from sheet in multiple cells

    Anytime I input random or ran or an index formula around it and move it to another cell it changes the original cell and not the new cell? I inputed:
    Please Login or Register  to view this content.
    this into cell C and copied it to cell B and when I copied it show "0" and when I copied it again it showed "0" in the next cell? Or...
    Please Login or Register  to view this content.
    does the same thing? What am I doing wrong or is this function only work per sheet? What I really want to do is create an if statement with multiple ifs that if a cell = "xyz",rand...
    Last edited by Pepe Le Mokko; 02-03-2020 at 12:05 PM. Reason: Removed unnecessary tags

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Want to generate random text from sheet in multiple cells

    Quote Originally Posted by crbenn01 View Post
    . . . I Inputed:

    =CHOOSE(RANDBETWEEN(1,57),goals!B4, . . . ,goals!B17,goals!C4, . . . ,goals!D4, . . . ,goals!D17,goals!E4, . . . ,goals!E17)
    Note: B4:E17 is 14 rows x 4 columns, so 56 cells. Do you want errors for the 1-in-57 times RANDBETWEEN returns 57? FWIW, you could get the same effect with the shorter

    =IF(RANDBETWEEN(1,57)=57,#VALUE!,INDEX(goals!B4:E17,RANDBETWEEN(1,14),RANDBETWEEN(1,4))

    this into cell C and copied it to cell B and when I copied it show "0" and when I copied it again it showed "0" in the next cell?
    FWIW, you're using RELATIVE references, so if you copy from a cell in col C to a cell in col B in the same row, the formula in col B would refer to goals!A4:D17. If goals!A4:A17 were blank or evaluated to 0, there'd be a 14/57 chance 0 would be the correct return value. Are you sure you don't want to use goals!$B$4,goals!$B$5,...,goals!$E$17 ?

    Your 2nd formula may indicate an error. Do you see a circular reference indicator in Excel's status bar at the bottom of the Excel application window? OTOH, are there any blank cells in Names!A:A above the last nonblank cell? Extreme example: if Names!A1:A20 were all blank and Names!A21:A36 were the only nonblank cells, your formula would sample in Names!A1:A16, so return 0.

    Given only your formulas but without seeing the cells/ranges your formulas are referencing, it's impossible to diagnose the problem other than educated guesses that relative rather than absolute references, circular references, or gaps in data could be the causes.

  3. #3
    Registered User
    Join Date
    11-14-2019
    Location
    Maryland
    MS-Off Ver
    Excel for MAC 16.3
    Posts
    12

    Re: Want to generate random text from sheet in multiple cells

    Hi, so i attached the file I'm using. I want the goal to correspond with the drop down. For example:

    If MTO is selected then a random goal from goals!d4:goals!e17 are selected
    If POS is selected then a random goal from goals!b4:goals!d17 are selected...
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Want to generate random text from sheet in multiple cells

    Quote Originally Posted by crbenn01 View Post
    . . .
    If MTO is selected then a random goal from goals!d4:goals!e17 are selected
    If POS is selected then a random goal from goals!b4:goals!d17 are selected...
    If you're printing the worksheet named February 7th, 2020, then you could use random sampling in Excel, and those printed exhibits would have fixed results. In Excel itself, formulas calling RANDBETWEEN will recalculate any time anything triggers recalculation. I'll assume this isn't a problem.

    I believe you mean row 11 cells in the February 7th, 2020 worksheet have the drop-down which contains MTO, POS, etc., and you want to pull in random entries in rows 13 and below based on the entry in that column in row 11, try

    C21: =INDEX(goals!$B$4:$E$17,RANDBETWEEN(1,14),RANDBETWEEN(1,4))

    That said, if you want no repeats in C21 and C29, you need to use supporting cells.

    C101: =RANDBETWEEN(1,14)
    C102: =RANDBETWEEN(1,4)

    C104: =RANDBETWEEN(1,13)
    C105: =RANDBETWEEN(1,3)

    C107: =C104+(C104>=C101)
    C108: =C105+(C105>=C102)

    Then

    C21: =INDEX(goals!$B$4:$E$17,C101,C102)

    C29: =INDEX(goals!$B$4:$E$17,C107,C108)

    Note: goals in rows 21 and 29 will always come from different columns and different rows in goals!B4:E17.

+ 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. [SOLVED] Generate Random Text In Cell Without Any Duplicates
    By BrownTeddyBear in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-14-2018, 10:35 AM
  2. VBA Text (4 colums) to Random Cells (4 Colums) sheet 1 to sheet 2 (excel 07)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-27-2017, 04:06 PM
  3. [SOLVED] Generate random comma separated lines of text from list without repeats
    By Banker123456 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2014, 12:00 AM
  4. Need to generate a random serial number that automatically populates the transmittal sheet
    By chriscole412 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-15-2012, 12:52 PM
  5. [SOLVED] Generate random 6-16-byte random hexadecimal number
    By jsamuelshn in forum Excel General
    Replies: 6
    Last Post: 07-20-2012, 10:38 AM
  6. How to generate random text
    By on_way_to_fame in forum Excel General
    Replies: 15
    Last Post: 09-27-2009, 04:16 PM
  7. generate a random number and use if function to generate new data
    By Dogdoc1142 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2006, 10:50 PM

Tags for this Thread

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