+ Reply to Thread
Results 1 to 4 of 4

Thread: Ignoring blanks with array formula?

  1. #1
    Registered User
    Join Date
    10-24-2011
    Location
    Bridport, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Ignoring blanks with array formula?

    Heyyo,

    I'm currently using an array formula to search through a table for multiple instances of one criterion and return text from another column:

    PHP Code: 
    {=IFERROR(INDEX(GrandTab,SMALL(IF(COUNTIF($C$4,INDEX(GrandTab,,1,1))>0,ROW(GrandTab)-MIN(ROW(GrandTab))+1),ROW(A7)),10),"")} 
    Where C4 is my criterion, and it looks through GrandTab to find all matching data, then returns lists of text from column 10. My problem is that many cells matching C4 have blank values in column 10, and I need to skip over those, so I get a solid list of text returns back from column 10 without a load of blanks in between.

    I've seen "<>" included to do this somehow, but I'm not sure how it works and where to use it.

    Any help you guys can offer would be greatly appreciated, thanks!
    Last edited by jetimmins; 10-25-2011 at 06:46 AM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,608

    Re: Ignoring blanks with array formula?

    Try:

    =IFERROR(INDEX(GrandTab,SMALL(IF(COUNTIF(INDEX(GrandTab,,1,1),$C$4)>0,IF(INDEX(GrandTab,,10,1)<>"",ROW(GrandTab)-MIN(ROW(GrandTab))+1)),ROW(A7)),10),"")
    by the way, it looked like you had the arguments in the COUNTIF reversed.... I switched them....
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    10-24-2011
    Location
    Bridport, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Ignoring blanks with array formula?

    Hiya NBVC,

    Firstly thank you much for your reply!

    I didn't think I had my COUNTIF arguments reversed but I'm still pretty new to array formulae, however when I do switch em like yours it's returning the wrong data :S If I leave it the way it is but use your code, it's still returning blank cells. I put a couple screenshots in:

    http://i.imgur.com/vzEwj.png - Array (blank returns still appearing)
    http://i.imgur.com/PiMHo.png - Data

    *EDIT* I just checked the blanks, they've actually got some spaces in! Sneaky, that must be it!

    Thanks again
    Last edited by jetimmins; 10-25-2011 at 03:59 AM.

  4. #4
    Registered User
    Join Date
    10-24-2011
    Location
    Bridport, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Ignoring blanks with array formula?

    I removed all the blanks and it's working perfectly, thank you! Sorry to be cheeky, but whilst I'm here, is there also a simple way of eliminating repeat entries as well? I've been trying to work in the FREQUENCY function but again, I'm not sure how to form it.

    Much love
    Last edited by jetimmins; 10-25-2011 at 05:24 AM.

+ 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.2.0