+ Reply to Thread
Results 1 to 6 of 6

Sorting blank data out of a list

  1. #1
    Registered User
    Join Date
    09-02-2011
    Location
    montreal, canada
    MS-Off Ver
    Excel 2007
    Posts
    30

    Sorting blank data out of a list

    Hello,

    First, let me say that I know a lot of threads have been done on this subject. I have been reviewing about 20 of them for the past two days and haven't found a proper solution to my problem. Well I found something very close but couldn't manage to make the formula work for my case or understand it well enough to write my own. I really need your wisdom here.

    I have a list of components interlaced with blank cells. I wanted this list to be the source of a drop down list but since I have a lot of blank data, the drop down list would have been painful to use. So from what I read, the best way of doing it would be to sort out the blank data out off the source first.

    I could do this with a simple filter on my column and unchecking "blanks". The problem with that is that this needs to be redone in order to refresh. I want the blank free list to update itself as soon as another component is entered. Same problem goes with sorting (AZ icon) the column to get blanks at the end.

    I would need the column besides my blank filled list to be a compact form of the list; blank free. I would really like a non VBA solution as I am a TOTAL NOOB with VBA. However, I always end up against the same wall : I can't loop with formulas.

    If you have any ideas, let me know.

    Thanks in advance.

    N.B. Same thread posted on another forum :
    http://www.mrexcel.com/forum/showthr...61#post2897961
    Attached Files Attached Files
    Last edited by Virgule; 10-14-2011 at 04:00 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sorting blank data out of a list

    the formula in B1 is an Array formula, any changes, confirm the formula by pressing CTRL-SHIFT-ENTER to reactivate the array, then copy down.

    C1: =SUMPRODUCT(--($A$1:$A$100<>""))
    B1: =IF(ROW(A1)>$C$1, "", INDEX($A$1:$A$100, SMALL(IF($A$1:$A$100<>"", ROW($A$1:$A$100)), ROW(A1))))

    ...array entered and copied down.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Sorting blank data out of a list

    Only for Excel 2007 or later.
    In B2;
    Arrayformula.
    Please Login or Register  to view this content.
    Insertion with Ctrl+Shift+Enter → not only Enter.
    Fill down as far as necessary.
    Attached Files Attached Files
    Kind regards, Harry.

  4. #4
    Registered User
    Join Date
    09-02-2011
    Location
    montreal, canada
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Sorting blank data out of a list

    Thanks HSV and JBeaucaire,

    I've tried JBeaucaire's solution and had some problems with it because I still had the column header has text and not sharing the formula. Also, I had the sumproduct elsewhere than C1. I don't really know why I couldn't make it work without these seemingly arbitrary conditions but it does work once everything begins on the first row.

    I have yet to try HSV's solution but I'm sure it'll work as well.

    So thanks to both of you for the help.

    Now I have a drop down list with all the non blank data grouped at the start of the list. A small issue occurs though. When I open up the drop down list, it shows data from the first blank entry down so the list looks empty. The non blank data is accessed by going up the list. Is there a way of showing the first non blank data as the first element in the list right when I open it ? I want to keep a large source for my data validation list as further components will be added by the user. Maybe that's the source of the problem. Checking the "ignore if blank" box doesn't seem to do anything.

  5. #5
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Sorting blank data out of a list

    Something like attachment?
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-02-2011
    Location
    montreal, canada
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Sorting blank data out of a list

    Yes attachment classeur1(1) has this resolved. I didn't know you could write formulas as source. I'll look into it.

    A big thank you to contributors.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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