Jun 11 2020 01:53 PM
I have a form to fill in excel with two columns First Name and Last Name. Both are validation lists and the last name should be dependent on the value of the first name. I have a total of 400 names. See below as an example:
Hidden worksheet with ONLY two columns:
FName | LName |
John | Doe |
Kevin | Hart |
Kevin | Kinsley |
Rob | Howard |
John | Rambo |
Visible sheet for the user
First Name: User to select
Dropdown List available:
John |
Kevin |
Rob |
Last Name: User to select based on the first name
Eg. If the user selects John, the dropdown list should be
Doe |
Rambo |
Similarly for Kevin and Rob.
I hope this is clear :)
Thank You
Jun 11 2020 02:35 PM
Here you go. I didn't create the form, but assume you can do that. This is an illustration of what the new Dynamic Array functions can perform. I used FILTER, UNIQUE, and SORT in this. You can add names to your heart's content in the table in the top left corner of the sheet. The drop-downs will automatically include the new ones, in alphabetical order.
Enjoy!
Jun 11 2020 02:41 PM - edited Jun 11 2020 02:45 PM
Hi @mathetes,
Thank you for helping out. I am getting this in all the cells that you have a formula in. :(
#NAME? |
I have excel 2016
Jun 11 2020 03:40 PM
"I have excel 2016"
The workbook uses functions only available in Office 365.
Functions like UNIQUE, FILTER and SORT tend to be manual operations in previous versions of Excel and are not that easy to emulate as formulas.
You may like the attached version of your workbook. The dependency between first and last names works both ways. The subordinate selection usually has to be cleared before the main selection is reselected.
Jun 11 2020 04:26 PM
i really apologize guys.
It still gives me an error.
This my excel version (image attached)
fname
=_xlfn._xlws.SORT(_xlfn.UNIQUE(_xlfn._xlws.FILTER(Employee[Fname], Employee[Lname]=LName.selected, Employee[Fname])))
lname
=_xlfn._xlws.SORT(_xlfn.UNIQUE(_xlfn._xlws.FILTER(Employee[Lname], Employee[Fname]=FName.selected, Employee[Lname])))
select fname
=_xlfn.ANCHORARRAY($H$3)
select lnname
=_xlfn.ANCHORARRAY($D$2)
Jun 12 2020 03:40 AM
SolutionThe attached might work in Excel 2016, but I have no way of finding out. Working without FILTER and UNIQUE is somewhat like trying to use a lawnmower to trim a hedge; simply the wrong tool for the job!
p.s. I have only just looked at the file you attached showing your Excel version. If it is Office 365 monthly then it is very odd that the original files do not work for you.
Jun 12 2020 05:45 AM
I agree with@Peter Bartholomew : If you have Office 365 Pro Plus (or whatever it was; that was the idea) it doesn't make full sense. You should check and see if you can get the latest Dynamic-Array-Ready version.
Unless you're in a government office where it takes a while; I did exchange a similar suggestion with someone last month. She had the latest on her Microsoft Surface pad and could see how the ARRAY functions worked, but the government supplied work computer wasn't able to run them and the IT department would take a while to get to it.
Those tools are quite astounding. This YouTube video is a great intro if you have any doubts.
https://www.youtube.com/watch?v=9I9DtFOVPIg
Jun 12 2020 03:40 AM
SolutionThe attached might work in Excel 2016, but I have no way of finding out. Working without FILTER and UNIQUE is somewhat like trying to use a lawnmower to trim a hedge; simply the wrong tool for the job!
p.s. I have only just looked at the file you attached showing your Excel version. If it is Office 365 monthly then it is very odd that the original files do not work for you.