+ Reply to Thread
Results 1 to 2 of 2

Choose a random task after selecting a person and time available.

  1. #1
    Registered User
    Join Date
    01-15-2016
    Location
    Leeds
    MS-Off Ver
    10
    Posts
    1

    Choose a random task after selecting a person and time available.

    Hi,

    I want to give my kids some tasks to do during the week and have been picking tasks from a hat but as they do everything on tech now, I want to create the same thing but in Excel.

    I have the attached spreadsheet with the tasks and amount of time it takes. I would like to be able to choose a task and choose a time for the task and a random task that fits both of those criteria will come up.

    Is this possible or what is the best way of doing this?

    Thanks

    Tony
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Choose a random task after selecting a person and time available.

    Interesting Problem.

    I used Data Validation in B2 and C2 and an Array Formula in D2.

    The formula is entered using Ctrl Shift Enter.

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    The Formula looks Horrendous, but it isn't to bad if you break it down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Will return an array of the row numbers 4 to 11
    Having enterd the formula in excel, select the ROW(A4:A11) in the formula bar and click f9 to see the array

    Press ctr1 z to escape


    alternatively enter =Sum(ROW(A4:A11)) using Ctrl Shift Enter which will return 60 which is 4+5+6+7+8+9+10+11.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Converts the name in C2 into a number 1 to 4 which we can use in the offset function to select the column where the name is listed

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Selects the Name Column That Corresponds with C2, ie column B offset by 1, 2, 3 or 4

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Counts the number of times the Name Appears in the Names Column and where the Time in Column B matches B2

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Returns an array of 1s and 0s showing which cells in B4-B11 match B2

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Returns an array of 1s and 0s showing which cells in the name column match C2


    multiplying the previous two formulas with
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    will return an array of 0s and the Rows matching our name and our time.

    So if we know how many matches we have ( Which Countifs gave us) we could use the RandBetween and the large functions to pick one of the non zero numbers in the array.

    So now we have a row number we can use Index or Offset to select the right cell in column A, I used offest but
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    would also have worked.
    Attached Files Attached Files
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ 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] Button choose a file and open. If person clicks cancel Excel still opens it.
    By szveronika in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2014, 08:20 AM
  2. [SOLVED] Randomly assing task to a person
    By dobracik in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-04-2014, 12:31 PM
  3. Replies: 0
    Last Post: 11-17-2013, 10:21 AM
  4. [SOLVED] Excel cannot complete this task with available resources. Choose less data or close other
    By YounesB3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-04-2013, 12:30 PM
  5. Calculating Total Time over Several Tabs per Person and Task
    By jshimko in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-27-2013, 02:12 AM
  6. Automating a Person-To-Task Distribution Process using Excel.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-21-2011, 09:44 AM
  7. Excel cannot complete this task with available resources. Choose less data or close o
    By jmswebdesign in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2007, 03:24 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