+ Reply to Thread
Results 1 to 2 of 2

Condensing a list/range with blank cells to a new list/range without blanks

  1. #1
    KR
    Guest

    Condensing a list/range with blank cells to a new list/range without blanks

    I have a list of cells, which are all dynamically linked to other stuff in
    my workbook. The main purpose is that the non-blank cells are "flags" that
    show that some task has not been completed. However, I have a long enough
    list that it isn't easy to look at, or print, because each cell is dedicated
    to one task.

    What I'd like to do is set a new range of cells to show only the "non-blank"
    cells from the larger range.

    I did put all my source cells in one column.

    Can anyone give me an easy formula that will check for each subsequent
    non-blank cell? I've been playing around with VLookup, but haven't gotten it
    working yet. It is also possible that the first (or first several) cells in
    my larger range might be blank, so that makes it a bit harder.

    Any help or code snippets would be greatly appreciated!

    Thanks,
    Keith

    --
    The enclosed questions or comments are entirely mine and don't represent the
    thoughts, views, or policy of my employer. Any errors or omissions are my
    own.



  2. #2
    Forum Contributor
    Join Date
    05-23-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Condensing a list/range with blank cells to a new list/range without blanks

    Hello Keith,

    I have just the solution for you.

    First of all, you need to make a named range.

    You can do this two ways.

    1. Go to Formulas>Name Manager>New

    a. Name your new range Blanks1 (for ease)
    b. In the little formula bar below type =yourfirstcell:yourlastcell


    OR


    2. Select the cells in the column corresponding to your data (all of them), click in the box to the left of the formula bar, type Blanks1 and hit enter. If you don't hit enter, it wont name that range.

    Okay, now for the formula once the range is created:

    =IFERROR(INDEX(Blanks1,SMALL((IF(LEN(Blanks1),ROW(INDIRECT("1:"&ROWS(Blanks1))))),ROW(A1)),1),NA())

    I originally obtained the base formula from another place I cannot remember. But if you put this into the column next to the one with the blanks, and hit CONTROL+SHIFT+ENTER you can then drag down to produce a column with no blanks but all your other data.

    You need to hit control+shift+enter because this is an array formula. If you just hit enter it won't work properly. Voila.

    The way this formula is set up, after the last entry #N/A will appear in every cell after. If you would rather the end cells be blank themselves, just replace NA() with "" at the end of the formula.

    As far as I have used this formula, I've always started it on row 3 (whatever column you choose). I honestly don't know if thats significant to its function but you should have it level with the column that you are trying to remove the blanks from.

    Hope this helps,

    Liquidmettle.
    Last edited by liquidmettle; 01-03-2014 at 12:45 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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