Dec 30 2020 02:55 PM
Dec 30 2020 02:55 PM
I'm wondering if it's possible to use the VLOOKUP formula to return an entire Data Validation List (with all possible options), not just the value that is currently selected.
In the attached example I'm using VLOOKUP to automatically fill in the instructor names of various courses by reading the entered course name (Column F) and returning the corresponding instructor (column G) based on the course/instructor list (Table 1). This works for all courses with only 1 possible instructor, but not with the "Math" course which has three possible instructors, which I've captured using a Data Validation List. Is it possible to use VLOOKUP to copy the whole list of the three possible instructors so that I could choose which one taught the course on a particular day?
Dec 30 2020 04:37 PM
VLOOKUP only returns the first instance in the match. A better alternative is to create a new column in Table 1 that can be used a reference for future lookups. This can be a Unique ID for the courses.
Now when referencing Courses in Table 2, the Unique ID will always return the respective instructor even if the course list is repeated, since the Unique ID is unique. That is the essence of working with relational databases in Excel.
Jan 05 2021 01:10 PM
Thank you for your reply. I don't think your suggestion solves my problem, but what I'm hearing is VLOOKUP can't be used to return a whole data validation list. I'll just have to change each entry that had multiple possible instructors manually. Thank you again for your time.
Jan 05 2021 04:20 PMSolution
No, you can't use VLookup, but you could still add data validation. The caveat is that you can't have user input and a lookup formula in the same cell, so you would need to add a column for user selection from the data validation list. Then, using an IF formula in the instructor field, you can perform a lookup when there is only one instructor, or pull from the user's selection from the data validation when there is more than one.
Feb 01 2021 03:49 AM - edited Feb 03 2021 01:11 AM
It can help you Hàm vlookup trong excel