+ Reply to Thread
Results 1 to 10 of 10

Filter, where certain line is missing

Hybrid View

  1. #1
    Registered User
    Join Date
    10-15-2007
    Posts
    11

    Filter, where certain line is missing

    Uh, im a little puzzled by this one. Since i'm no Excel specialist, maybe someone of You has an open mind and an easy way to do this.

    Basically, column A has phone numbers, column B has services associated with them. Since some numbers have more services, they have multiple occurences.

    I want to show only phone numbers, where certain service doesnt exist (oh, and no duplicates)

    I'm attaching a sample file, where i want to show only phone numbers, where "service 2" line is missing from.

    Maybe reverse it somehow? Show numbers, where this service exists and then reverse somehow?

    Any advice and guides are welcome

    Thank You,
    Rain
    Attached Files Attached Files
    Last edited by qingpool; 02-16-2011 at 08:15 AM. Reason: changed "cell numbers" to "phone numbers" - it was too confusing

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Filter, where certain line is missing

    Not sure you can do this with Auto Filter.

    One possibility would be to use formulae - using your sample file - and cell references are just for demo.

    L3: Service 2
    ie the Service of interest (so as to be dynamic going forward)
    
    L4:
    =SUMPRODUCT(($A$3:$A$29<>"")/COUNTIF($A$3:$A$29,$A$3:$A$29&""))-COUNTIF($B$3:$B$29,$L$3)
    confirmed with Enter
    gives you count of Cell nrs for which no Service 2 exists 
    (assumes Service 2 is not repeated for any given cell number)
    
    L5:
    =IF(ROWS(L$5:L5)>$L$4,"",INDEX($A$3:$A$29,MATCH(1,($A$3:$A$29<>"")*ISNA(MATCH($A$3:$A$29&"^"&$L$3,$A$3:$A$29&"^"&$B$3:$B$29,0))*ISNA(MATCH($A$3:$A$29,$L$4:$L4,0)),0)))
    confirmed with CTRL + SHIFT + ENTER (enter alone will not suffice)
    copied down to say L10
    given use of L3 - if you alter the Service value you should find the other cells adapt accordingly
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-15-2007
    Posts
    11

    Re: Filter, where certain line is missing

    Thank You very much, this works.

    I understand the first part - it counts distinctive values, then counts values with specified criteria, then substract the number from total distinctive values.

    The second part is an array formula, very advanced for me, but i get the point.

    My problem is, i know i have 333 phone numbers without that service. In every result, the formula changes by 2 numbers (in the beginning and in the end). How do i copy that formula so many times with only these values changing :D

    Thanks You for Your effort and help

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Filter, where certain line is missing

    Quote Originally Posted by qingpool
    My problem is, i know i have 333 phone numbers without that service. In every result, the formula changes by 2 numbers (in the beginning and in the end). How do i copy that formula so many times with only these values changing
    I'm afraid I don't really follow the above - could you perhaps post a further sample to illustrate ?

  5. #5
    Registered User
    Join Date
    10-15-2007
    Posts
    11

    Re: Filter, where certain line is missing

    Never mind that jibberish i said. I did something wrong last time i tried. The formula copying works fine - when i drag the box from the original result downwards.

    But the calculation is done very slow on my laptop - about 10 numbers a minute - is that really so CPU-hogging operation?

    Thanks

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Filter, where certain line is missing

    It won't be quick with very big data sets... how big is your real data set ?

    Are you looking to process multiple "services" simultaneously or will you only ever be analysing one "service" at any given point in time ?

    Is your dataset sorted or grouped together by Number & Service ?

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Filter, where certain line is missing

    perhaps
    =IF(OR(A3="",SUMPRODUCT(($A$3:$A$30=A3)*($B$3:$B$30="service 2"))>0),"",IF(COUNTIF($A$3:A3,A3)=1,"filter me",""))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Registered User
    Join Date
    10-15-2007
    Posts
    11

    Re: Filter, where certain line is missing

    Uhh, i went afk meanwhile and my laptop went to sleep! On AC power!!! Calculations ruined..

    Ok, did some some sorting and filtering. Now i have only 2 columns and 5500 rows of data.
    There is about 1800 phone numbers, which makes about 3 lines of services per phone number. About 300 of them dont have the "Service 2" - these are the ones i need to list.

    Applied the formula again, i dont know, now i calculates only about 1 number in 10 minutes. That cannot be right. My beard is growing faster.

    martindwilson, i tried Your formula, but what should i substitute "filter me" with? Forgiveme for my ignorance.

    Maybe there's a way to do this via multiple manual filterings and copy/paste?
    Maybe delete every mention of the numbers which have "Service 2" on some row? And then remove duplicates from others?

    Thank You
    Last edited by qingpool; 02-15-2011 at 01:03 PM.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Filter, where certain line is missing

    just drag down and auto filter on filter me or use a formula just to return the ones you want
    Attached Files Attached Files
    Last edited by martindwilson; 02-15-2011 at 06:04 PM.

  10. #10
    Registered User
    Join Date
    10-15-2007
    Posts
    11

    Re: Filter, where certain line is missing

    Thanks

    I ended up doing it yesterday evening the caveman way - selecting which ones have that service, putting them in one column, in the next column i would put all numbers and then used compare formulas.

    But i have now some very good tips from You for future analysis.

    Thank You guys

+ 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