+ Reply to Thread
Results 1 to 2 of 2

Random choosing of data in spreadsheet

  1. #1
    Forum Contributor
    Join Date
    06-03-2009
    Location
    Phoenix, Az
    MS-Off Ver
    MS Office 365
    Posts
    144

    Random choosing of data in spreadsheet

    Hello all.
    I am working on a spreadsheet for my company and what I am looking for is a program that will return to me randomly chosen pieces of information that is pulled from a report.
    What I need Excel to do is to randomly pull two names from the column called "employee" in relation to another column called "Location".
    For example, if I have a spreadsheet with 7 lines under the column "employee" with the name "John Smith" working in a location called "Whitefish Bay" & "Jan Smith" working in a location called "Whitefish Bay" & 6 lines named "Bob Johnson" under "Whitefish Bay".

    Out of those 3 sets of names in location of Whitefish Bay, I need something that will randomly choose two "John Smith"s, two "Jane Smith" & Two "Bob Johnson". But I also need the program to be to do the same randomly choosing the same number of employees but with different locations.

    Is this even possible?

    Thanks.
    Dave

    PETE UK - you helped me with something similar a few days ago. But it took a different twist.
    Attached Files Attached Files

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Random choosing of data in spreadsheet

    Try the following which denotes its choice with an X in column 3

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.
    Martin

+ 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