Search code examples
google-sheetsdropdown

Google Sheets Dynamic Dropdown List Dependent with multiple rows


working doc

'Ref'!A2:A --> a list of unique codes 'Ref'!B2:B --> a list of corresponding clients (with some duplicates; some clients are associated with multiple codes)

'Main'!B2:B --> dropdown of clients ('Ref'!B2:B)

*** I would like 'Main'!C2:C to be a dynamic dropdown list that is dependent on the selection in Column B. In other words: if 'Main'!B2 = John Smith, then 'Main'!C2 should give me the options 24JOSM01 and 24JOSM02.


Solution

  • To do this type cascading dropdown in google-sheet, you will need an additional helper sheet. So, use the following formula to HelperSheet A1 cell.

    =MAP(Main!B2:B,LAMBDA(x,IF(x="","",TOROW(FILTER(Ref!A:A,Ref!B:B=x)))))
    

    Then use data validation to sheet Main as Dropdown (From a Range) and use this formula =HelperSheet!1:1.

    Here is link of sheet dynamic_dropdown_test.

    enter image description here