+ Reply to Thread
Results 1 to 11 of 11

Data Validation That Feeds A Dependant Drop Down Menu

  1. #1
    Registered User
    Join Date
    08-10-2015
    Location
    Kilmarnock
    MS-Off Ver
    2013
    Posts
    5

    Data Validation That Feeds A Dependant Drop Down Menu

    Hi There,

    I'm new to this forum so I hope I'm posting this in the correct section.

    I only understand excel at a very basic level; Sumif formula's and basic conditional formatting. I'm looking for some advice on how to go about building a spreadsheet that will help me manage the allocation of my staff to projects. All I think I need is someone with the right knowledge to tell me what formulas (if any exist) I should be looking to use to make the workbook do what I require.

    I have 30 employees that I need to allocate across 10 - 15 projects at any one time, but each week different ones are on holiday, so realistically I only ever have 25 to pick from due to others being on holiday.

    I have a weekly table on excel that has projects 1 - 15 listed down column A and Mon - Sun listed along row 1. Currently I manually type in each staff member against the project that they will be working against then manually double check I've not doubled up on someone by allocating them to two projects.

    What I want to produce (or what I think I want to produce) is the following:

    Tab 1: A list of all my employees that I can update to mark which employees are available and which are on holiday for the entire week that I am planning work for (note: some employees might only be off for 1 or 2 days so they are available on certain days)

    Tab 2: my weekly table (projects 1 - 15 down the left and Mon - Sun across the top). I want to then be able to click on Project 1's Monday cell and get a drop down box that only shows me the names of those that are marked as being available on Monday from Tab 1

    I also need the dropdown box to only let me use each employee once per day.

    I hope I'm making sense. If someone was able to point me in the direction of the correct formula's that I would need to be using I'm sure I would be able to read up about these online and work it out.

    Thanks in advance for any help I receive.
    Last edited by Cammy1984; 08-11-2015 at 02:08 PM.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Formula Help & Advice

    off the top of my head I think the best way to do this is to populate the weekly table with say "X" against each user on the days theyre in, then create data validation on the Project days cells to look up the list of names, you'll likely need to read up on OFFSET and INDIRECT in order to populate the drop downs based on which have X in the relevant day (I think this > http://www.contextures.com/xlDataVal02.html may be useful).

    Personally, id then say that once you've selected a staff member then populate their day in tab1 with the name of the Project (this serves two purposes, it allows you to see what a single user has worked on and it removes them from the list for that day (as they no longer have X in the relevant column).

    To do that you'll need a tiny bit of VBA in the Worksheet_Change event.

    And basically, I think that would give you a very very basic version of what you're after.

    So the very least you'll need to read up on are OFFSET, INDIRECT, WORKSHEET_CHANGE event and NAMED RANGES. None of which are complicated, just some are a little bit strange at first.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,223

    Re: Formula Help & Advice

    The attached is a sample of how you might configure a workbook.

    The main formula used is the one creating the named ranges for employees available for each day:

    =IFERROR(INDEX(Employees!$A$2:$E$20,SMALL(IF(Employees!B$2:B$20="A",ROW(Employees!$A$2:$A$20)-ROW(Employees!$A$2)+1,""),ROWS($1:1)),COLUMNS($A:$A)),"")

    It is an array formula and must be entered with Ctrl+Shfit+Enter.

    Looks a bit daunting but creates the list of employees with code A

    The previous post pointed you a site where you can find an explanation of dependent drop-down lists: this technique is used in this sample.

    To check you only select an employee once will require VBA coding - so leave that till later!

    Hope this helps.
    Attached Files Attached Files

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Formula Help & Advice

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  5. #5
    Registered User
    Join Date
    08-10-2015
    Location
    Kilmarnock
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula Help & Advice

    Thanks very much for your help guys, I now know what sort of Formula's I now need to go read up on. Thanks again.

  6. #6
    Registered User
    Join Date
    08-10-2015
    Location
    Kilmarnock
    MS-Off Ver
    2013
    Posts
    5

    Data Validaiton That Feeds A Dependant Drop Down Menu

    Hi There,

    Thanks again for your advice.

    I'm not sure if I'm meant to start a new thread or continue developing the solution in this one - Hopefully I'm doing it correctly. I've been working on a sheet that starts off doing what I want (copy attached);

    Synopsis of the attached Workbook

    Tab 1 "Availability": This is where I mark which employees are available on which days of that week. I've set up a data validation drop down box on each cell which is also conditionally formatted to change colour for ease of review each week.

    Tab 2 "Project Allocation": This is where I have a problem and could really do with some more assistance or a point in the right direction.

    Column B "Monday" has a drop down box that's linked to VBA coding so that I can select multiple employees to work on Monday against one project. The coding also allows me to re-select a previously selected employee and it will remove them from that project.

    Problems Requiring Solutions:

    The four problems that I don't understand how to solve on Tab 2 are:

    1: I need the drop down list for Monday to only allow me to select employees that are marked as available or provisionally available on Monday on Tab 1

    2: I need the drop down box also to update as I allocate employees, for example if I use employee 6 on Monday project 1 they will no longer appear in the drop down box for any other project thereby making them impossible to double allocate.

    3: I need same drop down box rules to appear on Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday and pull the relevant data as to employees availability from Tab 1

    4: The final thing that would be good to have on Tab 2 would be some sort of conditionally formatted text colour so that Available employees are shown in green text and provisionally available employees are shown in Amber text.


    Thanks again for anyone who takes the time to read and/or try to assist me in solving this problem.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,223

    Re: Data Validation That Feeds A Dependant Drop Down Menu

    I haven't looked at your file yet but see how much of your need is met by the attached:

    The formulae used are as per previous postings.

    Checks if employee allocated for a given day ...


    =IFERROR(IF(MATCH(C2,Projects!$B$2:$B$16,0),"X",""),"")

    Re-creates the dropdown list(s) as employees are allocated.


    =IFERROR(INDEX(Tables!$C$2:$C$20,SMALL(IF(D$2:D$20<>"X",ROW($A$2:$A$20)-ROW($A$2)+1,""),ROWS($1:1)),COLUMNS($A:$A)),"")
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-10-2015
    Location
    Kilmarnock
    MS-Off Ver
    2013
    Posts
    5

    Re: Data Validation That Feeds A Dependant Drop Down Menu

    Thanks for your e-mail John, I had a footer about with your excel doc and done a bit of reading up on IF Formula's to make some progress.

    I'm now half way to where I want to be and have attached an updated sheet to better illustrate my remaining issues.

    I have now included a table on tab 1 in Columns O - U that only pulls forward those employees that are marked as being available on the specific day. The first problem that I have is that my "Employee No.1" only shows on the table if two employees are selected and "Employee No.50" just doesn't seem to exist - I think its something to do with the last part of my formula but not sure.

    Tab 2 then pulls uses data validation drop down lists that pull the data of available employees from the table I have created in columns O - U on tab 1. The problem that I have here is that I don't understand how to recode the VBA coding to allow Columns C - H to behave in the same way as the drop down box in column B?

    The final query that then remains is how I make the drop down lists on tab 2 only allow me to use each employee once on each day (providing that they are available as per the table in tab 1)

    At this stage, I'm considering just forgetting about having "provisionally" available employees as it looks like it could involve a seriously big formula.

    Any help would be greatly appreciated.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,223

    Re: Data Validation That Feeds A Dependant Drop Down Menu

    I have done the following changes:

    The selection formula in availability to (effectively) the version in my example :

    =IFERROR(INDEX($A:$A,SMALL(IF(OFFSET($A$3:$A$52,0,MATCH(O$2,$B$2:$H$2,0))="Yes",ROW($A$3:$A$52),""),ROW()-2)),"")

    The VBA code has a minor change:

    Please Login or Register  to view this content.
    from
    Please Login or Register  to view this content.
    so it works on columns B to H

    For the last problem i.e. only allocate an employee once: the solution is the last workbook I sent you.

    The columns DValMon (named ranges) etc are the "dynamic" dropdown lists which automatically change when an employee is assigned to a project.

    You need a column to signify someone has been selected (the columns with "X" in them) and then re-generate the list omitting these entries.

    All the formulae are in my workbook.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-10-2015
    Location
    Kilmarnock
    MS-Off Ver
    2013
    Posts
    5

    Re: Data Validation That Feeds A Dependant Drop Down Menu

    Thanks for sorting that VBA code john, its greatly appreciated.

    I wonder if you can explain what it is that I am doing wrong when I try and replicate your formulas from the dependant drop down list page? I've tried messing around with it, but I just don't understand enough about excel to work it out as I don't really follow what it is that the formula is actually doing?

    I've attached my best effort at the formula to see if you can spot my mistake?
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,223

    Re: Data Validation That Feeds A Dependant Drop Down Menu

    I could not see anything wrong with your formula: I copied one of mine and changed the ranges and it worked !

    =IFERROR(INDEX(Availability!$A$3:$H$52,SMALL(IF(Availability!B$3:B$52="Yes",ROW($A$3:$A$52)-ROW($A$3)+1,""),ROWS($1:1)),COLUMNS($A:$A)),"")

    Attached has the updated "Table" tab.
    Attached Files Attached Files

+ 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. Need formula advice
    By kikis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-26-2015, 06:14 AM
  2. VBA code advice/Excel advice for summing groups of numbers
    By paulblower in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2014, 05:47 AM
  3. IF Formula advice
    By jkility in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-12-2014, 11:23 AM
  4. if formula - need advice
    By koi in forum Excel General
    Replies: 5
    Last Post: 09-25-2012, 11:35 AM
  5. Formula Advice
    By max308 in forum Excel General
    Replies: 7
    Last Post: 09-07-2011, 01:53 PM
  6. [SOLVED] need formula advice
    By CdnMichael in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2006, 07:20 PM
  7. [SOLVED] Advice on formula Please
    By Tempy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-24-2005, 02:06 PM

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