+ Reply to Thread
Results 1 to 14 of 14

Range selection List with no blank cells

  1. #1
    Forum Contributor
    Join Date
    04-22-2017
    Location
    AU
    MS-Off Ver
    Microsoft 365
    Posts
    291

    Range selection List with no blank cells

    Hi all,

    Trying to create a Drop-down selection list using Data Validation from a a Named rage but because the Range has blank cells, these blanks also come up in the Dropdown list.
    This Drop-down list needs to allow for adding removing changing names so the names list could be hundreds of names, but exclude blank cells when using the Drop-down selection list.

    Having read many discussions, it would seem Dynamic ranges and tables are involved?
    Have tried several processes using OFFSET, UNDEX but just cannot seem to get my thinking logic around these functions.

    Attached is my attempt.

    Assistance please - No VBA.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Range selection List with no blank cells

    Try this ARRAY formula...
    =IFERROR(INDEX(B:B,SMALL(IF($B$4:$B$15<>"",ROW($B$4:$B$15)),ROWS($A$1:A1))),"")
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Then copy down as needed.

    This works for the 1st set of names, as you have shown.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    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,981

    Re: Range selection List with no blank cells

    Here's the formula you need in H4 copied down to create your gap-free list:

    =IFERROR(INDEX(B$4:B$500,MATCH(ROWS(B$4:B4),INDEX(COUNTIF(B$4:B$500,"<="&B$4:B$500),0),0)),"")

    Unlike Ford's formula, this does not require array entering. Use this for your validation list. Remember this list can be anywhere and could be hidden.
    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.

  4. #4
    Forum Contributor
    Join Date
    04-22-2017
    Location
    AU
    MS-Off Ver
    Microsoft 365
    Posts
    291

    Re: Range selection List with no blank cells

    Thankyou Ali

    I pasted the formula into a Data Validation List in H4 and I get the below. What am I not doing correctly
    Validation Error.jpg
    Could you please please paste the attached Work book as appropriate.

  5. #5
    Forum Contributor
    Join Date
    04-22-2017
    Location
    AU
    MS-Off Ver
    Microsoft 365
    Posts
    291

    Re: Range selection List with no blank cells

    Thankyou Ali

    I get the following and I don't understand why.
    Validation Error.jpg

    Seems I did not explain the outcome I am seeking very well.

    Attached is an amended WorkBook which chows in Col H what I am hoping for.
    That is - a validation cell in each row of column H, which when used, lists all the names with no blank cells so I can select the appropriate name to place in the cell.

    Can you please place the correct Formula in the attached Wbook?
    Attached Files Attached Files
    Last edited by VisionSmart; 02-03-2019 at 06:22 AM.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Range selection List with no blank cells

    H4 use Ali's formula

    Data validation use
    =OFFSET($H$4,,,COUNTIF($H:$H,"?*"))
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    04-22-2017
    Location
    AU
    MS-Off Ver
    Microsoft 365
    Posts
    291

    Re: Range selection List with no blank cells

    Thanks Bo_Ry.

    Please see above and updated attached Workbook - Ver B.
    I believe a formula needs to go in the Validation
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Range selection List with no blank cells

    One more approach
    In H4 Then copied down.Column H is a helper column. If you don't want helper column worksheet event with VBA code is to be used.

    =IFERROR(INDEX($B$4:$B$500,AGGREGATE(15,6,ROW($B$4:$B500)/($B$4:$B$500<> ""),ROWS($H$4:$H4))-ROW($B$4)+1),"")

    For validation

    =$H$4:INDEX($H$4:$H$500,COUNTIF($H$4:$H$500,"*?"))
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 02-03-2019 at 06:50 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Range selection List with no blank cells

    Quote Originally Posted by VisionSmart View Post
    I believe a formula needs to go in the Validation
    You can't remove the blanks in validation in single step. All of the suggestions provided are to be used in a worksheet (a hidden one if desired) to create a copy of the list on the sheet without the blanks.

    You then refer to the new list in the data validation.

  10. #10
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Range selection List with no blank cells

    Using Sheet2 column 'A' row 5 insert formula and copy down (60 lines ??)

    Please Login or Register  to view this content.
    Using Sheet2 column 'B' row 5 insert formula and copy down (60 lines ??)

    Please Login or Register  to view this content.
    In your 'Name manager' change reference to

    Please Login or Register  to view this content.
    Leave 'conditional formatting' as at present.
    Attached Files Attached Files

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

    Re: Range selection List with no blank cells

    Quote Originally Posted by VisionSmart View Post
    Thankyou Ali

    I pasted the formula into a Data Validation List in H4 and I get the below. What am I not doing correctly
    I told you to use the formula to create a helper column, not in the data validation box.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Range selection List with no blank cells

    Although I didnt explicitly say to put my suggestion in a worksheet cell, then copy down, that's what I meant, as well.

  13. #13
    Forum Contributor
    Join Date
    04-22-2017
    Location
    AU
    MS-Off Ver
    Microsoft 365
    Posts
    291

    Re: Range selection List with no blank cells

    Thank you

    All good now

  14. #14
    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,981

    Re: Range selection List with no blank cells

    Thanks for letting us know.

+ 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] Condensing a list/range with blank cells to a new list/range without blanks
    By KR in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-03-2014, 12:41 AM
  2. [SOLVED] Condensing a list/range with blank cells to a new list/range without blanks
    By KR in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  3. Condensing a list/range with blank cells to a new list/range without blanks
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 07:05 AM
  4. [SOLVED] Condensing a list/range with blank cells to a new list/range without blanks
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 06:05 AM
  5. [SOLVED] Condensing a list/range with blank cells to a new list/range without blanks
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  6. Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  8. [SOLVED] Condensing a list/range with blank cells to a new list/range without blanks
    By KR in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-05-2005, 12:05 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