Forum Discussion

robustexcel's avatar
robustexcel
Copper Contributor
Jun 11, 2020
Solved

Data Validation cascading

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

JohnDoe
KevinHart
KevinKinsley
RobHoward
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

  • robustexcel 

    The 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.

     

6 Replies

  • robustexcel 

    "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.

    mmathes 

    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.

    • robustexcel's avatar
      robustexcel
      Copper Contributor

      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)

      • PeterBartholomew1's avatar
        PeterBartholomew1
        Silver Contributor

        robustexcel 

        The 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.

         

  • mathetes's avatar
    mathetes
    Silver Contributor

    robustexcel 

     

    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!

    • robustexcel's avatar
      robustexcel
      Copper Contributor

      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

Resources