+ Reply to Thread
Results 1 to 7 of 7

Formula to populate a list without blanks.

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Seguin, TX
    MS-Off Ver
    Excel 20007
    Posts
    28

    Formula to populate a list without blanks.

    I have a list of data with 2 column. One is a column of unique values, the other column has a lot of blanks.

    I'd like to auto generate both columns without any of the blank data from column 2. I've attached a mock spreadsheet of what I'm invisioning.

    Thanks you!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: Formula to populate a list without blanks.

    Please see the attached array formula (Entered with Ctrl Shift Enter)

    Example 1.2.xlsx
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula to populate a list without blanks.

    In F5
    =IF(ROWS(A$1:A1)>COUNT($C$5:$C$27),"",INDEX($B$5:$B$27,SMALL(INDEX(($C$5:$C$27<>"")*(ROW($C$5:$C$27)-ROW($C$5)+1),),COUNTBLANK($C$5:$C$27)+ROWS(A$1:A1))))

    In G5
    =IF(F5="","",SUMIF($B$5:$B$27,F5,$C$5:$C$27))

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to populate a list without blanks.

    Enter this array formula in F5 and pull to G5 and then down

    =IFERROR(INDEX(B:B,SMALL(IF($C$5:$C$27<>"",ROW($C$5:$C$27)),ROWS($F$5:F5))),"")

    ...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. Press F2 on that cell and try again.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Registered User
    Join Date
    06-06-2012
    Location
    Seguin, TX
    MS-Off Ver
    Excel 20007
    Posts
    28

    Re: Formula to populate a list without blanks.

    Thanks everyone.....these give me a couple differen options!

  6. #6
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: Formula to populate a list without blanks.

    Got the solution..

    check the attachment..

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Don't forget to click *
    Attached Files Attached Files

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula to populate a list without blanks.

    I've been thinking a lot recently about this type of solution, and after several OPs have come back to me saying that their workbooks have practically crashed when calculating a large number of these array formulas, I've now realised that the method used by Ace_XL here is much, much preferable to the standard IFERROR(... construction.

    Obviously in this case the number of rows is so small as to make the difference in performance insignificant, but in general it's certainly worth doing: dragged down to several thousand rows' worth, the version with IFERROR will still calculate the array part, whether it's beyond the last "necessary" row or not.

    Using the IF clause nullifies these unnecessary calculations for further rows, and so gives a considerable improvement is performance. In fact, better still is to have the row limit calculation in a separate cell somewhere, and reference this in the formula, i.e.:

    =IF(ROWS($1:1)>$X$1,...

    etc.

    The reason I mention it is just in case people are interested and happen to be reading this thread. The more so because the vast majority of solutions proposed along these lines (including until recently mine!) still opt for the (inefficient) IFERROR(... option.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

+ 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. Replies: 8
    Last Post: 06-15-2016, 09:53 AM
  2. Generate a list without blanks from a list with blanks
    By Tpmoss1 in forum Excel General
    Replies: 2
    Last Post: 11-28-2012, 04:35 PM
  3. [SOLVED] Create new list without blanks through formula
    By Rob2101 in forum Excel General
    Replies: 3
    Last Post: 06-14-2012, 07:41 PM
  4. Validation List ignore blanks (formula)
    By portmontreal in forum Excel General
    Replies: 2
    Last Post: 07-16-2009, 02:52 PM
  5. removing blanks from list by formula
    By reggie1000 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-29-2007, 01:01 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