+ Reply to Thread
Results 1 to 7 of 7

Help creating drop-down validation list with specific criteria

  1. #1
    Registered User
    Join Date
    10-17-2019
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    5

    Question Help creating drop-down validation list with specific criteria

    I hope I can describe this in a way that makes sense.

    I'm trying to make it so 'spreadsheet b'!D2 is a dropdown list of all the text based options on 'spreadsheet d'! B2:B100 where the value in 'spreadsheet d'!A2:A100 = 'spreadsheet b'!C2

    I'm familiar with using the data validation to create a dropdown list from a range of values, but I'm unsure of how to add conditions on the values being displayed.

    Any help or guidance would be greatly appreciated.
    Last edited by Mooklie; 10-21-2019 at 09:22 PM.

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Help creating drop-down validation list with specific criteria

    If I am correctly understand, your problem is empty lines in drop down list due to the fact that not all values of A are equal C and range B2:B100 gives values and also empty lines.
    Or something like this.

    Please attached sample file with some mock data and described inside expected results. It is always very helpful to understand the issue.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Help creating drop-down validation list with specific criteria

    Try something like this:

    In spreadsheet b cell G2:
    =IFERROR(INDEX('spreadsheet d'!B:B,AGGREGATE(15,6,ROW('spreadsheet d'!A$2:A$1100)/('spreadsheet d'!A$2:A$1100=C$2),ROWS($1:1))),"")
    Drag the formula through G100

    Then go to Formulas > Define Name > Name: DVlist > Refers to:
    ='spreadsheet b'!$G$2:INDEX('spreadsheet b'!$G$2:$G$100,SUMPRODUCT(--('spreadsheet b'!$G$2:$G$100<>"")))
    OK

    Now select cell D2 > Data > Data Validation > Allow: List > Source: =DVlist > OK

    See attachment.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-17-2019
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Help creating drop-down validation list with specific criteria

    Thank you both for your help so far.

    I'll attach my excel sheet to better describe what I'm after as requested, and then I'll try 63falcondude's recommendations and see if I can get it working.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-17-2019
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Help creating drop-down validation list with specific criteria

    I've had a look and this solution definitely works - however for Major Themes or as you reference them 'conditional values', there will be multiple and they will vary from project to project and throughout the duration of the project - I don't know that the users will be able to (or perhaps just too confusing for them) create separate DV lists for each new conditional value as they arise... also I'm not sure that the drop down list will automatically know which DV list to reference on the depending 'conditional value'

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Help creating drop-down validation list with specific criteria

    Try this:

    Format your data in Sub Topics into a table. I gave the headers "Major Theme" and "Sub Topic".

    D1 =IFERROR(INDEX(Table1[Major Theme],MATCH(0,COUNTIF($C1:C1,Table1[Major Theme]),0)),"") Ctrl Shift Enter
    Drag to the right as far as needed (I went through M1 to allow for an additional 6 major themes).

    D2 =IFERROR(INDEX($B:$B,SMALL(IF(Table1[Major Theme]=D$1,ROW(Table1[Major Theme])),ROWS($1:1))),"") Ctrl Shift Enter
    Drag to the right as far as you dragged the previous formula then down as far as needed (I went through row 100 to allow for a total of 99 sub topics per major theme).

    Now select cells D2:D1000 in the Grab Board worksheet > Data > Data Validation > Allow: List > Source:
    =OFFSET('Sub Topics'!$D$1,1,MATCH($C2,'Sub Topics'!$D$1:$M$1,0)-1,COUNTIF(OFFSET('Sub Topics'!$D$1,1,MATCH($C2,'Sub Topics'!$D$1:$M$1,0)-1,99,1),"?*"),1)
    OK

    See attachment.
    Attached Files Attached Files

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Help creating drop-down validation list with specific criteria

    Thanks for the rep!

+ 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. Creating URL Validation Function
    By k2hunter in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 12-30-2020, 08:04 PM
  2. Creating macro that inserts data into a cell based on certain critera
    By anjoseph9626 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2013, 07:49 PM
  3. Duplicates & creating new number after validation
    By Nasir Choudhary in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2013, 11:26 AM
  4. Help with creating VBA to filter validation list
    By emwhite in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-13-2010, 12:37 PM
  5. Creating a Macro for Cell Validation
    By alfavest in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-01-2007, 11:40 AM
  6. creating validation list in VBA
    By Stefi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-13-2006, 07:55 AM
  7. creating a validation
    By MIKE0W in forum Excel General
    Replies: 3
    Last Post: 06-14-2005, 01:05 PM

Tags for this Thread

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