+ Reply to Thread
Results 1 to 10 of 10

Drop-down list that filters values (without having a separately filtered list)

  1. #1
    Registered User
    Join Date
    04-11-2022
    Location
    Zurich
    MS-Off Ver
    2016
    Posts
    5

    Drop-down list that filters values (without having a separately filtered list)

    Hello,
    my question might be trivial for some users, anyways: I have an (unsorted) list of dates in one of my workbooks and I want to convert this list into a drop-down list. However, I need the content of the drop-down list to be only unique values and sorted as well. Hereby, I want to get rid of the extra list that is normally generated. I want the drop-down to contain the formula and generate the list on its own.

    I attached an Excel file with an MWE.

    In addition, since I use Excel 2016, some functions are not accessible to me, e.g. the "unique" function. However, I tried this function in Excel online, and it seems to not work, it responds with an error...

    Is that possible, or do I always have to create the filtered list first, and reference the filtered list with the drop-down?

    Best regards and thanks a lot in advance,
    Thewald
    Attached Files Attached Files
    Last edited by Thewald; 04-12-2022 at 08:22 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Drop-down list that filters values (without having a separately filtered list)

    As far as I know you have to create the filtered list first and reference it.

  3. #3
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Drop-down list that filters values (without having a separately filtered list)

    Rather than give you a simple formula (Which it does become a rather simple array once understood) here is a link that will walk you through it so that you fully understand what you are writing to make the most of it.

    Let me know if you still struggle to get it working after this... I understand you are in a couple versions back but it will work and we can even break it into parts so that you always see the breakdown on a validation sheet that you reference for your drop down menu later.

    Have fun!

    https://www.get-digital-help.com/cre...array-formula/

    - Eddie
    -If you think you are done, Start over - ELeGault

  4. #4
    Registered User
    Join Date
    04-11-2022
    Location
    Zurich
    MS-Off Ver
    2016
    Posts
    5

    Re: Drop-down list that filters values (without having a separately filtered list)

    Thanks a lot for both replies!

    I watched the explanation to extract unique items from a list, and it gave me a good overview of the functions I could use. However, it does not solve my problem directly.
    The array function needs to be copied to as many cells as I expect unique values in my initial list. But I want the function to return a list of unique values in one cell, so to say. In addition,
    what I forgot to mention in my original post, is that I also need the dates to be reformatted, so that only years are returned, and from the years I want the unique values.

    I will play around a little with what I got from the explanation.

    I also managed to get the latest functions (dynamic array functions) to work by using Excel online. However, the 'unique' function does not work in a drop-down list, it throws:
    "The list source must be a delimited list, or a reference to single row or column.".

    Maybe nick.williams is right, and there is no such option of having the drop-down dynamically extract the values on its own. Why is that? Is there a specific reason this is not working?
    I guess the 'unique' function does not return a "delimited list", but what does it return?

    Again, thanks a lot in advance
    Thewald

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,800

    Re: Drop-down list that filters values (without having a separately filtered list)

    UNIQUE returns an array. 365 users can turn an array into a delimited list using the TEXTJOIN function - they would nest the UNIQUE function inside.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    04-11-2022
    Location
    Zurich
    MS-Off Ver
    2016
    Posts
    5

    Re: Drop-down list that filters values (without having a separately filtered list)

    Thanks a lot for the reply!

    I tried to wrap the 'textjoin' function around the 'unique' function. The result put into a cell, in fact, looks like the required delimited list.
    However, putting the formula as it is ( =TEXTJOIN(",";TRUE;UNIQUE(_named_range_)) ) into the data validation field does not yield a useful result.
    The settings window for the data validation closes without error, however, the cell does not have a drop-down arrow next to it, and therefore no
    options are visible. Furthermore, putting anything into that cell results in an error (I tried values, and also putting the formula into the cell,
    to see if it interprets the formula as a string for some reason).

    It seems that data validation does not accept the outcome of the 'textjoin' function as a valid list.

    Any suggestions?

    Thanks a lot in advance again!
    Thewald

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Drop-down list that filters values (without having a separately filtered list)

    Yes, a Data Validation list has to be a reference to an actual range of worksheet cells.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  8. #8
    Registered User
    Join Date
    04-11-2022
    Location
    Zurich
    MS-Off Ver
    2016
    Posts
    5

    Re: Drop-down list that filters values (without having a separately filtered list)

    Thanks a lot then! I will go with the separate range on a hidden worksheet.
    Best regards, Thewald

  9. #9
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Drop-down list that filters values (without having a separately filtered list)

    One thing that works fairly well with the 365 functions is that you can refer to array formulae that spill for the Data Validation list, so you don't get blanks or have to guess how many rows you need.

    For example in your sample sheet, if you want a sorted unique list of the years, you could put =SORT(UNIQUE(YEAR(A2:A9))) in E2. This will return 2021, 2022, 2023 and 2024 in E2:E5. But for your data validation you can refer to E2# which will always give you the results of the formula in E2.

  10. #10
    Registered User
    Join Date
    04-11-2022
    Location
    Zurich
    MS-Off Ver
    2016
    Posts
    5

    Re: Drop-down list that filters values (without having a separately filtered list)

    I implemented that, and it works. Thanks a lot!
    Best regards, Thewald

+ 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] Count Values in Filtered List / Return Final Row in a Filtered List
    By HarryGreenwood in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-22-2018, 06:52 AM
  2. Drop down list (data validation) using a range with filters
    By Nox in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-09-2015, 09:36 PM
  3. Excel drop down list that filters applicable results
    By MissAudrey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-13-2015, 01:29 PM
  4. Drop Down list on 1 Sheet, filters all other sheets
    By audan2009 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 01:24 PM
  5. Error when feeding pivot filters from drop down list
    By icyrius in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2013, 03:18 PM
  6. Pivot Table Drop Down List (filters)
    By ndreid in forum Excel General
    Replies: 2
    Last Post: 08-22-2012, 01:52 PM
  7. I need a drop down list that auto completes and filters at the same time
    By TranceDiablo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-01-2011, 09:06 AM

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