+ Reply to Thread
Results 1 to 12 of 12

Dynamic dropdown in Excel

  1. #1
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    231

    Dynamic dropdown in Excel

    Hello All,

    I have 2 requirements to create dynamic dropdown in excel when the selections are in the form of a table.

    1. Based on my selection of ERP in K5, I should have a drop down for CoCode (J8). This drop down is derived from CoCo tab.In CoCo tab I pull, Col D values as dropdown for col F which is my ERP selection.

    2. Based on CoCode in JE sheet, I populate L8 (Loc) in JE sheet. Based on the L8, I should have a drop down in G8(SrcAcct). This is driven from 'Acct' sheet.Col D values are the drop down values based on Col B.

    Attached the sheet.

    Can you please help on this. Quick help is much appreciated.

    Thanks much in advance.
    Attached Files Attached Files

  2. #2
    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
    30,915

    Re: Dynamic dropdown in Excel

    Named ranges

    CoCode =OFFSET(CoCo!$F$2,MATCH(JE!$K$4,CoCo!$F$3:$F$14,0),-2,COUNTIF(CoCo!$F$3:$F$14,JE!$K$4))

    SrcAcct =OFFSET(Acct!$D$1,MATCH(JE!$L$8,Acct!$C$2:$C$11,0),,COUNTIF(Acct!$C$2:$C$11,JE!$L$8))

    G8 Data Validation : List .==>> =SrcAcct

    J8 Data Validation List ==>> =CoCode
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    231

    Re: Dynamic dropdown in Excel

    Thanks much for quick reply John. This helps for sure.

    My actual record count in CoCo sheet is around 45k and Acct sheet is around 450K and is dynamic.

    Can you please suggest how can we make the formula dynamic.

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

    Re: Dynamic dropdown in Excel

    To make it fully dynamic:

    3 Named ranges (CTRL-F3 to view/edit):

    Code:
    =$D$3:INDEX($D:$D,AGGREGATE(14,6,MATCH({1E+100,"Zzzz"},$D:$D),1))

    ERP
    =$F$3:INDEX($F:$F,MATCH("Zzz",$F:$F))

    List (for DV)
    =$J$3:INDEX($J:$J,SUMPRODUCT(--(LEN($J$3:$J$26)>0)))

    In the last one, change the 26 to whatever is realistic... but not to a whole column reference.

    For the second one... two named ranges

    Acct:
    =$D$2:INDEX($D:$D,MATCH("Zzzz",$D:$D))

    SRC (for DV):
    =$K$3:INDEX($K$3:$K$26,SUMPRODUCT(--(LEN($K$3:$K$26)>0)))

    In the last one, change the 26 to whatever is realistic... but not to a whole column reference.
    Attached Files Attached Files
    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

  5. #5
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    231

    Re: Dynamic dropdown in Excel

    Thanks much Glenn. I tried your code and see it is not working for CoCode (col J). when I select BH, I am getting only one value instead of 2 and if I select Oscar, I see CoCo, which is not in my list. Can you please help.

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

    Re: Dynamic dropdown in Excel

    Silly, silly mistake on my part. In the SRC and List Named ranges... change all the 25s to whatever is sensible and future proof.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    231

    Re: Dynamic dropdown in Excel

    Hi John,

    I have expanded my selection to 30 rows in CoCo sheet and the below logic does not work for the range selected. Can you please help.

    CoCode =OFFSET(CoCo!$F$2,MATCH(JE!$K$4,CoCo!$F$3:$F$30,0),-2,COUNTIF(CoCo!$F$3:$F$30,JE!$K$4))
    Attached Files Attached Files
    Last edited by BMD4; 01-02-2022 at 10:18 PM.

  8. #8
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    231

    Re: Dynamic dropdown in Excel

    Thanks for the logic Glenn. I tested it and see it is not working as expected for Acct. eg. The SrcAcct in dropdown is not same as 'MC_SAP_FM'.

    Can you please advise. Attached the file.
    Attached Files Attached Files
    Last edited by BMD4; 01-02-2022 at 09:42 PM.

  9. #9
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Dynamic dropdown in Excel

    May I ask, is it possible to sort data in
    CoCo ( base on column F )
    Acct ( base on column C )

    if yes , please try

    CoCode validation
    =IF(COUNTIF(CoCo!$F:$F,JE!$K$4)>0,OFFSET(CoCo!$D$1,MATCH(JE!$K$4,CoCo!$F:$F,0)-1,0,COUNTIF(CoCo!$F:$F,JE!$K$4)),"")

    SrcAcct validation
    =IF(COUNTIF(Acct!$C:$C,JE!$L8)>0,OFFSET(Acct!$D$1,MATCH(JE!$L8,Acct!$C:$C,0)-1,0,COUNTIF(Acct!$C:$C,JE!$L8)),"")

    Regards.

    Note : my formula is refered all column , it not good for performance but I usally use them because in my environment
    most of worksheet can't determine number of rows. it's become my bad habits.
    Attached Files Attached Files

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

    Re: Dynamic dropdown in Excel

    You've lost me here " The SrcAcct in dropdown is not same as 'MC_SAP_FM'". There seems to be something missing in your description of the requirement (or my understanding of it)!!

    Please explain the connection.

  11. #11
    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
    30,915

    Re: Dynamic dropdown in Excel

    Using OFFSET ..

    Sort CoCo by ERP and ACCT by PartName

    NOTE: Glenn's AGGREGATE formulae do NOT require the data to be sorted.

    Named range "Acct" in Glenn's file)

    =IFERROR(INDEX(Acct!$D:$D,AGGREGATE(15,6,ROW($D$3:$D$50)/(Acct!$C$3:$C$50=JE!$L$8),ROWS($1:1))),"")
    Attached Files Attached Files
    Last edited by JohnTopley; 01-03-2022 at 05:45 AM.

  12. #12
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    231

    Re: Dynamic dropdown in Excel

    Thanks so much Menem. This works.

+ 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. [SOLVED] Having trouble with a dynamic dropdown and dynamic named range
    By Ryan_M14 in forum Excel General
    Replies: 11
    Last Post: 11-11-2021, 01:43 PM
  2. How to create dynamic dropdown in excel?
    By needhelp13 in forum Excel General
    Replies: 11
    Last Post: 02-05-2021, 03:16 PM
  3. Creating a Dynamic Dropdown List in Excel
    By newbie1234 in forum Excel General
    Replies: 1
    Last Post: 02-23-2020, 03:32 AM
  4. Dynamic Dropdown
    By juriemagic in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2019, 02:11 AM
  5. Dynamic chart dropdown help
    By Redder Lurtz in forum Excel General
    Replies: 2
    Last Post: 11-20-2015, 12:16 PM
  6. Dynamic dropdown list via data validation in Excel
    By ronin21 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-22-2012, 07:01 AM
  7. Dynamic Dropdown
    By Chemo in forum Excel General
    Replies: 1
    Last Post: 07-28-2011, 07:08 PM

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