+ Reply to Thread
Results 1 to 3 of 3

Need Help: Remove blanks from a named range containing numerical values

  1. #1
    Registered User
    Join Date
    11-20-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    5

    Need Help: Remove blanks from a named range containing numerical values

    I'm using the formula
    =OFFSET(Sheet1!$I$2,,,COUNTIF(Sheet1!$I$2:$I$6,"?*"))
    in the Name Manager to remove blanks from a data range (I need to remove blanks because I will be using these values in a log function).
    When I2:I6 is filled with non-numerical values, it works fine, tested with data validation -> list/drop down menu on cell B11.

    However, when I place numerical values into cells I2:I6, the named range freaks out. For every numerical value I have in I2:I6 range, it will remove the bottommost value from that range.

    So suppose I have:
    10
    a
    b
    12
    e
    the named range will only return 10, a, and b, deleting 12 and e in I5:I6 because I have 2 numerical values.

    Obviously, when the entire range is filled with numerical values, the named range will not return any values.

    How can I get a named range with numerical values while removing blank cells?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-20-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    5

    Re: Need Help: Remove blanks from a named range containing numerical values

    Nevermind, I solved it myself. The problem was the countif function. All I needed to do was change "?*" to ">0"

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need Help: Remove blanks from a named range containing numerical values

    You would have to create a new list containing only the numeric values.

    This array formula** entered in K2 and copied down to K6.

    =IFERROR(INDEX(I:I,SMALL(IF(ISNUMBER(I$2:I$6),ROW(I$2:I$6)),ROWS(K$2:K2))),"")

    **array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Then, as the source for the drop down use:

    =OFFSET($K$2,,,COUNT($K$2:$K$6))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Remove Blanks With Dynamic Named Range - Error with the formula
    By Tepsjen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-23-2014, 05:34 PM
  2. Array to remove blanks from Range, how do I apply the range back to my sheet??
    By seanpears99 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-06-2013, 02:11 AM
  3. Replies: 2
    Last Post: 12-28-2011, 11:22 PM
  4. Non blank named range from named range with blanks
    By goels in forum Excel General
    Replies: 3
    Last Post: 10-24-2011, 12:54 PM
  5. Ignoring blanks in a dynamic named range
    By jman0707 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-09-2008, 11:10 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