+ Reply to Thread
Results 1 to 10 of 10

Populate Data Validation List with items shorter than 9 characters in range

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Populate Data Validation List with items shorter than 9 characters in range

    Hello,

    I often use the Data Validation List to present selectable values to a cell.

    In this case, I only need the values from a range that are less than 9 characters long (there are also longer items in the same range).

    I know how to use for instance the Offset function to add a range to a named range and use it as a Data Validation List, but am struggling to filter out the shorter values.

    Any solutions?

    Grtz, Bart
    Attached Files Attached Files
    Last edited by BartH_NL; 05-08-2021 at 11:57 AM.

  2. #2
    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
    79,343

    Re: Populate Data Validation List with items shorter than 9 characters in range

    I won't be following any links, sorry.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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.

  3. #3
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: Populate Data Validation List with items shorter than 9 characters in range

    OK AliGW,
    I missed the "Manage Attachments" section, so had to improvise.
    Fixed it now.
    Grtz Bart

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,420

    Re: Populate Data Validation List with items shorter than 9 characters in range

    This proposal employs a helper column (F) which may be moved and/or hidden for aesthetic purposes.
    Column F is populated using: =IFERROR(INDEX(E$2:E$32,AGGREGATE(15,6,(ROW(E$2:E$32)-ROW(E$1))/(LEN(E$2:E$32)<9),ROWS(A$1:A1))),"")
    The 'Refers to' for 'List' is now: =OFFSET(Sheet1!$F$1,1,0,SUMPRODUCT(--(Sheet1!$F$2:$F$32<>"")))
    No change to the 'Source' for the Data Validation drop down.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,803

    Re: Populate Data Validation List with items shorter than 9 characters in range

    Your profile mentions 365 so here is an option for that version. Some where on the sheet, enter this formula:

    =FILTER(List,LEN(List)<9)

    Let's say that was entered in cell Z2.
    Then in the data validation pop-up screen, choose Allow LIST (like you already have), and in the source, enter =Z2#

  6. #6
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: Populate Data Validation List with items shorter than 9 characters in range

    ThnX JeteMC,
    for your solution. I would not have found this solution easily on my own, but I understand how it works and it certainly does the job and you gave me something to explore.

    Your solution, Gregb11, is one of the recently added formulas and indeed also gives the required result (in a more compact form).
    I tried to incorporate this formula in the named range formula I had,
    but as this is an array formula that doesn't work.
    I can write the named range like this:
    Attachment 732161

    but then I can't use that in the Data Validation List, so I have to construct a "shadow" list on a sheet to let the array formula do its work.

    Nevertheless, I am curious if there is a way we could make the Data Validation List accept the ProjectNumbers named range...

    When I try that now, I get an error message and it doesn't work:
    Attachment 732162

    Grtz, Bart

  7. #7
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,803

    Re: Populate Data Validation List with items shorter than 9 characters in range

    The links you supplied are invalid. Please attach a file like you did in your first post.

  8. #8
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: Populate Data Validation List with items shorter than 9 characters in range

    OK,
    The images I meant to present are below (I hope) and in the meanwhile, I also worked out a new sample file with a working solution,
    although I still wonder if it would be possible to catch everything in one named reference.
    Attached Images Attached Images
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,420

    Re: Populate Data Validation List with items shorter than 9 characters in range

    ThnX JeteMC,
    for your solution. I would not have found this solution easily on my own, but I understand how it works and it certainly does the job and you gave me something to explore.
    You're Welcome and thank you for the feedback. I hope that you have a blessed day.

  10. #10
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,803

    Re: Populate Data Validation List with items shorter than 9 characters in range

    I'm not 100% sure I follow, but I think I do, and I don't think you can do that. I think you have to have the FILTER formula in a cell on the sheet, then your named range can reference that cell (with a # sign afterwards, like =Z2#).

+ 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. Replies: 4
    Last Post: 07-09-2018, 02:58 PM
  2. [SOLVED] List unused items from data validation list without blanks
    By L plates in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-27-2015, 09:02 AM
  3. Replies: 2
    Last Post: 09-17-2014, 09:35 AM
  4. Replies: 1
    Last Post: 11-05-2013, 12:40 AM
  5. Validation list (with illegal characters in the range list)
    By Elainefish in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-04-2013, 04:38 PM
  6. Data Validation: items in one list relate to items in another
    By Paul D. Simon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2005, 05:05 PM
  7. Replies: 1
    Last Post: 06-24-2005, 12:21 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