+ Reply to Thread
Results 1 to 38 of 38

Blank cells in named ranges

  1. #1
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Blank cells in named ranges

    Hi,

    I have a list of data lets say between J3:J52 and would like to create a drop down box accordingly

    I've created a named range between those cells which works the drop down lovely...except

    The data is constantly changing and could often result in empty cells which I am after excluding from the drop down.

    I've tried formulas in the named range box such as:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    but all of these result in no drop down data at all
    Name manager with any of these formulas just shows {...} under value

    Please may I kindly ask what I am doing wrong?

    Many thanks

  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
    80,410

    Re: Blank cells in named ranges

    Attach the 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-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    File attached

    My named ranges are on the dropdowns tab
    My dropdowns themselves are on the Print tab

    many thanks
    Attached Files Attached Files

  4. #4
    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,410

    Re: Blank cells in named ranges

    There are two ways to get at a result here: either change the way that you generate the dynamic lists (my preferred option) or fiddle with the validation formula - which do you want?

  5. #5
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    I'll go with your preferred if that's ok please

    Many thanks

  6. #6
    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,410

    Re: Blank cells in named ranges

    Really sorry - I've been called away. Hopefully someone else will step in.

  7. #7
    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,410

    Re: Blank cells in named ranges

    I'm back, but I am afraid I am unable to work with your attachment - it keeps crashing Excel.

  8. #8
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    Hmm, strange

    I've re-saved the document as macro-free
    The only macro that was in there was the 'print rota' button on the Print sheet

    Hopefully this version will work.

    Many thanks
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    Did you get any luck opening the file please ?

    Many thanks

  10. #10
    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,410

    Re: Blank cells in named ranges

    No - I didn't see it. It wasn't opening the original file that was the issue, it was trying to work with it.

    I will have a look at your new file later today.

  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,410

    Re: Blank cells in named ranges

    OK, so for example in E3 of your DropDowns tab:

    =IFERROR(INDEX(Setup!$C$4:$C$53,MATCH(0,IF(ISBLANK(Setup!$C$4:$C$53),"",COUNTIF(E$2:$E2,Setup!$C$4:$C$53)),0)),"")

    ... 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. Once confirmed, drag copy down.

  12. #12
    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,410

    Re: Blank cells in named ranges

    Let us know how you get on.

  13. #13
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    Many thanks for this,

    This command helps putting all names at the top so there are no blanks in between,
    However, unfortunately the drop down list is full of blanks at the bottom

    I've created a Name for the list in name manager and allocated the range: =DropDowns!$E$3:$E$52

    Is there a command that can replace that in which will ignore the blanks

    I've just tried as recommended from this post:
    Please Login or Register  to view this content.
    in the name manager but once again that went to {...} again and the drop down does not work

    Many thanks

  14. #14
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    Just changed it to:
    Please Login or Register  to view this content.
    unfortunately still the same

  15. #15
    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,410

    Re: Blank cells in named ranges

    Can you attach your latest attempt?

  16. #16
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    File attached,

    Had to edit it down and remove some tabs as is beginning to get rather big lol

    Many thanks
    Attached Files Attached Files

  17. #17
    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,410

    Re: Blank cells in named ranges

    I will have a gander.

  18. #18
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Blank cells in named ranges

    I haven’t viewed your file yet, but perhaps just amend the formula to
    =OFFSET(DropDowns!$E$3,0,0,COUNTIF(DropDowns!$E:$E,”?*”),1)
    Don
    Please remember to mark your thread 'Solved' when appropriate.

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

    Re: Blank cells in named ranges

    Where is the faulty DD being used?
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

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

    Re: Blank cells in named ranges

    For dynamic dropdowns which contain formula blanks, I always use this type of formula to make the dynamic DD list:

    =OFFSET(Sheet1!$a$2,,,SUMPRODUCT(--(LEN(Sheet1!$a$2:$a$100)>0)))

  21. #21
    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,410

    Re: Blank cells in named ranges

    I'm stumped, I'm afraid - sorry.

  22. #22
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    The DD is being used on sheet 'Print'

    There are 2 drop downs:
    D2 = category list
    L2 = Dynamic name list

    If D2 is set to Tonne_7.5, L2 drop down works but has a magnitude of blanks at the bottom (I have only have the formula =DropDowns!$D$3:$D$52 for this named range at the moment.
    If D2 is set to Tonne_3.5, L2 drop down does not work, (I currently have the formula =OFFSET(DropDowns!$E$3,0,0,COUNTA(DropDowns!$E:$E),1) for this named range.

    I have just tried:
    Please Login or Register  to view this content.
    But this had the same result as previous.

    Many thanks

  23. #23
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    Quote Originally Posted by xlnitwit View Post
    I haven’t viewed your file yet, but perhaps just amend the formula to
    =OFFSET(DropDowns!$E$3,0,0,COUNTIF(DropDowns!$E:$E,”?*”),1)
    Unfortunately this did not work either

    Many thanks for all your suggestions/assistance
    Very much appreciated

  24. #24
    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,410

    Re: Blank cells in named ranges

    If it were me, I'd start again. Something is wrong, but I can't put my finger on what it is. In any case, you probably don't need all the steps you are taking to derive those drop-down lists. There must be an easier way.

    I'm afraid I'm not offering to find that easier way for you - don't have time today for a project like that!

  25. #25
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    Thankyou very much for taking a look AliGW
    Very much appreciated.

    Please don't take this the wrong way, But in a way I'm happy it stumped you, being someone who knows there stuff.
    I don't feel as dumb as I thought I was being lol

    Many thanks

  26. #26
    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,410

    Re: Blank cells in named ranges

    I know what you mean - but there are wizards lurking, so we'll probably both end up looking stupid.

  27. #27
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Blank cells in named ranges

    I think i found a way.
    In the formula of AliGW for the dropdowns I changed the result of the IFERROR formule from "" to "-" in column D of Dropdowns-sheet

    Please Login or Register  to view this content.
    And I also noticed that for some reason when using arrayformula the standard COUNTA formula comes back with 50 all the time so I changed the validation formula for Tonne_7.5 to include a countif formula that counts the number of "-" values and substract it from the countA
    Please Login or Register  to view this content.
    hope this solves your problem.

  28. #28
    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,410

    Re: Blank cells in named ranges

    Well, how's that for a forum debutant's opening post?

    Good solution, Roel, although it would be great to get to the bottom of why things were not working as expected. At least Jason has a way to move forward now.

    Welcome to the forum!

  29. #29
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Blank cells in named ranges

    Haha, thanks for the welcome, new here, but been doing "training laps" on other forums (mostly Dutch)

    You are right.. it is a bit of "works by accident" solution, I think the COUNTA formula might even be obsolete in the named range formula by a fixed number, 50 in this example (as that seems to be the outcome always.)

    I'm not sure why the COUNTA does not work, my theory is that it has to do with that COUNTA cannot see there are array formulas in the selected range and therefor sees the cell content as "not blank" and counts it as filled cell

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

    Re: Blank cells in named ranges

    Probably, which is why I suggested starting from scratch.

  31. #31
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    Many thanks

    I have tried inputting that exactly as shown, but still when on the Print tab when you select Tonne7.5 in the left pull down, the right pull down remains empty
    Dropdowns.jpg


    Many thanks
    Attached Files Attached Files

  32. #32
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Blank cells in named ranges

    Tried changing the code to:
    Please Login or Register  to view this content.
    still no luck

    If I start again, will have to do it later due to my kids being 'dad, dad, dad' lol

    Appreciating all your help here, happy to try all suggestions that come my way.

    Many thanks

  33. #33
    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,410

    Re: Blank cells in named ranges

    It's Saturday - family time.

    I've already suggested that starting again might be the best option - clean slate. We'll be here when you are ready to proceed with this.

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

    Re: Blank cells in named ranges

    Are you OK with a bit if VBA to sort this out?

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

    Re: Blank cells in named ranges

    One more Q. Why are you hugely complicating this by having the q and w in A and B53 of Setup??? What function do they serve in your real data?

  36. #36
    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
    28,147

    Re: Blank cells in named ranges

    You cannot use INDIRECT to reference dynamic ranges Which use OFFSET without a "work around"

    See here

    http://www.contextures.com/xlDataVal02.html#Dynamic

    See Section "Using Dynamic Lists"

    See attached where I have created drop downs for "Tonne_7.5" , "Tonne_3.5" , "Drivers Mate" and "CPW"

    Curious as to why you have duplicated data from "Setup" in "Dropdowns"

    NOTE: removed "extraneous" letters (q,w etc) from "Setup" columns
    Attached Files Attached Files
    Last edited by JohnTopley; 04-07-2018 at 09:59 AM.

  37. #37
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Blank cells in named ranges

    You can also use EVALUATE in place of INDIRECT though it requires an additional defined name and the workbook must be macro enabled (though it appears the latter was the case already). Updated version attached with dynamic names using COUNTIF as I suggested previously.
    Attached Files Attached Files

  38. #38
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Blank cells in named ranges

    In the attached find:

    1. the list Department copied and transposed as a table header in row 1 of 'DropDowns'.
    2. the same formulas used in post #31 attachment in 'DropDowns'.
    3. for the Name DD validation formula in L2
      Formula: copy to clipboard
      Please Login or Register  to view this content.

    I retained the q, w, a ... in 'Setup'. I'm guessing they are there to confirm the formulas are removing blanks.

    There are no INDIRECT references to D2. They are all MATCH references.

    Formulas in 'Print' P1 and T1 have no function. Those were just convenient places to build the DD formula. I left them in case they aid in following this. They can be deleted.
    Attached Files Attached Files
    Dave

+ 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] Delete blank rows at the bottom without affecting named ranges
    By billj in forum Excel General
    Replies: 7
    Last Post: 05-11-2017, 08:15 AM
  2. Check if all named ranges in a given sheet are blank
    By riffology in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2014, 12:51 PM
  3. Ignore blank cells and truly blank cells in named range?
    By hschillig in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-13-2014, 02:56 PM
  4. Replies: 0
    Last Post: 10-15-2012, 07:24 AM
  5. Advanced filter with blank cells / Dynamic named range with blank cells
    By Jason_2112 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2010, 12:06 PM
  6. [SOLVED] List all the named ranges & the cells they refer to on a blank she
    By Hervinder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2006, 07:00 PM
  7. Dynamic Named Ranges with Blank Cells
    By andibevan in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-17-2005, 01:48 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