+ Reply to Thread
Results 1 to 22 of 22

Data Validation List and Vlookup Combined

  1. #1
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Data Validation List and Vlookup Combined

    Hi Guys.. I have a similar problem. I have Names in one column and their role titles in 2nd. I want a formula to select Names in 1st column and it should return titles in 2nd column but If I select "Select by Role" in 1st column then it should give me drop down list of role titles in 2nd column. Can you help me with formula

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Data Validation List and Vlookup Combined

    Attach a sample workbook with some data and what you expect as a result.

    Go Advanced -> Manage Attachments -> Upload

  3. #3
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    here it is
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    I have a list of Names and "Select by Role" in column A. If i select any name from Column A then it should give his title automatically and if i select Select By Role in column A then it should give me a drop down in Column B with all the available Roles.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Data Validation List and Vlookup Combined

    The file that you have attached is not working. The dropdowns are stuck. It is not possible to change the selections. Please check your file and upload it again. The Named range NAME is NOT in the file. it is on your server. So the file is, in effect, dead.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    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,346

    Re: Data Validation List and Vlookup Combined

    You cannot reference other workbooks for Data Validation criteria ("Names").

  7. #7
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    Hi Guys. I dont have any macro work book. I need one to build a formula into this. I will reference the names and titles from another sheet in the same workbook. What I need is, If I select a particular name in column A from the drop down list then it should auto populate their corresponding titles in Column B. And if I select "Select By Role" from drop down in Column A then I should get an option in Column B as a drop down for the available titles. I currently just have created a drop down in column A with the names and "Select By Role".

  8. #8
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,372

    Re: Data Validation List and Vlookup Combined

    Try re-upload your file with table that used by data validation

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Data Validation List and Vlookup Combined

    No-one mentioned macros. The file you attached has a link to an external file which we don't have. So the dropdowns do not work. So we can not help. Modify your file WITHOUT links to an external sheet and repost.

  10. #10
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    Here is the file with a separate tab that I used for Data Validation. Will this help.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    I have posted the file with the new tab that I used as data validation. Also I could find the formula that would work but as soon as I select "Select by Role" and select a title in other column, I am unable to toggle back and select a Name in first column which will give me a title in 2nd column.
    =IF((VLOOKUP(C2,'Names'!A:B,1,1))="SELECT BY ROLE", 'Names'!B:B, VLOOKUP(C2,'Names'!A:B,2,0))

  12. #12
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Data Validation List and Vlookup Combined

    If you can post expected result it would be good...
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  13. #13
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    What I need is, If I select a particular name in column A from the drop down list then it should auto populate their corresponding titles in Column B. And if I select "Select By Role" from drop down in Column A then I should get an option in Column B as a drop down for the available titles. I currently just have created a drop down in column A with the names and "Select By Role".

  14. #14
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Data Validation List and Vlookup Combined

    Sorry but you are not explaining the things, you are just speaking about one drop down that is select by role and you have created a name manager for JOB which range is B4:B9. Can you please let us know which Job role will be allocate for others selection?

  15. #15
    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,346

    Re: Data Validation List and Vlookup Combined

    You will need VBA to do this.

  16. #16
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    I dont have any others selection to be made. I need like this. If I select a particular name in column A then I it should look up its title in column B. I select "Select By Role" in column A then I would be able to get a drop down of the roles of those available names in column A. There wont be any additional roles. It will be the same roles that I need.

  17. #17
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    Yes but what would be the code.

  18. #18
    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,346

    Re: Data Validation List and Vlookup Combined

    Try

    Please Login or Register  to view this content.
    This code in in tab *Sample": right click on tab, "View Code", copy/paste code above

    Please Login or Register  to view this content.
    I added various named range:

    "Role_Names":

    in D2

    =IFERROR(INDEX(Name,SMALL(IF(Job=Sample!$D$2,ROW(Job)-ROW($A$2)+1,""),ROWS($1:1))),"")


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Then copy down

    Column C in "Names" is list of Roles

    Named range: "Roles"

    =OFFSET(Names!$C$2,,,COUNTIF(Names!$C$2:$C$100,"?*"),1)

    Other named ranges defined in same way.

    To "execute" double click on cells C2 OR D2 in "Sample"
    Attached Files Attached Files
    Last edited by JohnTopley; 05-08-2018 at 11:41 AM.

  19. #19
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    Hi John. Thank you so much for working out this for me. But I guess this is not exactly what I wanted. If I select by Name its giving me a corresponding role name but I also want Select By Role in the same drop down n column C and in the next column D I want all the available role names in the drop down. If I then select any role name in column D it should NOT give me all or any corresponding name for that role name in Column C. Column C should still be having "Select By Role" as selected. Is this achievable.

  20. #20
    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,346

    Re: Data Validation List and Vlookup Combined

    I am sure it is but I believe the solution provides what you want (your solution is not intuitive with regard to column headings).

    Logically, you either want to know the the role(s) of a given person OR a list of people for a given role.

    To me, nothing else makes sense!

    If I then select any role name in column D it should NOT give me all or any corresponding name for that role name in Column C.
    So why select a role if nothing is to result?

  21. #21
    Registered User
    Join Date
    05-04-2018
    Location
    Sydney, Australia
    MS-Off Ver
    2016
    Posts
    65

    Re: Data Validation List and Vlookup Combined

    There is another process that I then need to undertake based on this selection. If I select a name in Column A it will give me a role in Column B and further it will do a vlookup to get their salary. If I dont know the name, I will select "Select By Role" in column A and then in column B I should be able to select from all the available roles and then based on this selection, I will taking an average of salaries for persons having the same role. The sample I gave is just for 5 people but I have a list of 10,000 people which I need to sort. If i get to this stage then I will be able to get further. Is this something that can be achieved.

  22. #22
    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,346

    Re: Data Validation List and Vlookup Combined

    What is the difference between selecting a role in column B or in column A?

    Whether required or not the names are required, you have a list of ALL people who can perform that role. So if "System Engineers" is the selected role, then you get a list of people who are "System Engineers".

    I will taking an average of salaries for persons having the same role
    so having the name is no inconvenience as it does not impact the calculation of the average salary of a given role.

    It appears to me that you making something relatively simple more difficult.

    Irrespective of my view, ask a moderator to move this thread to the VBA/Macro thread and I suggest to post a file showing exactly how you want this to work.

+ 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. Data Validation List and Vlookup combined
    By Meunixx in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-04-2018, 02:40 AM
  2. Vlookup to update the duplicate results in list(data validation list)
    By cheTAN kc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2017, 10:06 PM
  3. IF Formulas Combined w/Data Validation
    By howe7032 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2014, 02:44 PM
  4. How to build the combined Formula and join it with Data Validation list..!!
    By mzaheer_abbas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-17-2014, 11:19 AM
  5. VLookup in VBA using data validation list
    By chriscusick in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-31-2013, 04:17 AM
  6. Data Validation List from a VLookup Cell
    By kiz1988 in forum Excel General
    Replies: 2
    Last Post: 04-12-2013, 06:54 AM
  7. Replies: 1
    Last Post: 09-05-2012, 11:39 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