+ Reply to Thread
Results 1 to 14 of 14

Filtering fonction

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Québec
    MS-Off Ver
    Excel 2002
    Posts
    14

    Filtering fonction

    Hello everyone,

    I have a serie of value in a column, most of these values are redundant. In another column I want each unique value.

    car car
    car truck
    car apple
    truck house
    truck
    apple
    apple
    apple
    house
    house

    Users can add anything at the end of serie of values (in the first column), and I need right away to have the result on the second column, preferably without Macro.

    Anyideas about a function that can do that?

    Thanks !

  2. #2
    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: Filtering fonction

    Copy and paste formula in B2 and drag it down

    =IF(ISERROR(INDEX($A$2:$A$11,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$2:$A$11),,),))),"",(INDEX($A$2:$A$11,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$2:$A$11),,),))))

    A
    B
    2
    car car
    3
    car truck
    4
    car apple
    5
    truck house
    6
    truck
    7
    apple
    8
    apple
    9
    apple
    10
    house
    11
    house
    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

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Filtering fonction

    Try this...


    Data Range
    A
    B
    1
    Header1
    Header2
    2
    car
    car
    3
    car
    truck
    4
    car
    apple
    5
    truck
    house
    6
    truck
    7
    apple
    8
    apple
    9
    apple
    10
    house
    11
    house
    12
    13
    14
    15


    This array formula** entered in B2 and copied down as needed:

    =LOOKUP("zzzzz",CHOOSE({1,2},"",INDEX(A$2:A$100,MATCH(0,COUNTIF(B$1:B1,A$2:A$100),0))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Use a reasonable end of range where I use down to row 100.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Filtering fonction

    Another way to get unique records from a list:
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    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: Filtering fonction

    Quote Originally Posted by Tony Valko View Post
    Try this...

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Use a reasonable end of range where I use down to row 100.
    Hi Tony. Is there any other purpose for the portion of your formula LOOKUP("zzzzz",CHOOSE({1,2},"" simply to hide error? The other part of it INDEX(A$2:A$100,MATCH(0,COUNTIF(B$1:B1,A$2:A$100),0) does the job anyway when entered as an array?


    Oh, I understand now. This is really cool. Makes a formula much smaller when writing it for Excel 2003 and earlier.

    Thanks
    Last edited by AlKey; 11-27-2013 at 04:54 PM.

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Filtering fonction

    It is an error trap. Leave a blank cell in the list and the filter stops at the blank. I have seen this before but I can't remember why this was important at the time. Written the way that you mention, the blank cell is replaced by a 0 and continues.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Filtering fonction

    Quote Originally Posted by AlKey View Post
    Makes a formula much smaller when writing it for Excel 2003 and earlier.
    Not just shorter, but more efficient, also!

    Do you understand how the LOOKUP function is trapping any errors?

  8. #8
    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: Filtering fonction

    I do now and thanks for sharing this little gem

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Filtering fonction

    ______

  10. #10
    Registered User
    Join Date
    10-08-2013
    Location
    Québec
    MS-Off Ver
    Excel 2002
    Posts
    14

    Re: Filtering fonction

    Thanks Tony and the others.

    Tony's solution works well. It took me a litle bit of time to implement because I work on a Excel 2002 french version so I had to translate function and change "," by ";" :
    =RECHERCHE("zzzzz";CHOISIR({1;2};"";INDEX(A$2:A$100;EQUIV(0;NB.SI(B$1:B1;A$2:A$100);0))))

    Many thanks

  11. #11
    Registered User
    Join Date
    10-08-2013
    Location
    Québec
    MS-Off Ver
    Excel 2002
    Posts
    14

    Re: Filtering fonction

    ………………………..
    Last edited by zara_toustra; 11-28-2013 at 11:34 PM. Reason: After a fews hours with excel I've answered myself.

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

    Re: Filtering fonction

    data starting in a2 then this will do it in b2 copied down

    =IFERROR(INDEX($A$2:$A$11,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$2:$A$11),0,0),0)),"")
    "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

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Filtering fonction

    You're welcome. Thanks for the feedback!

  14. #14
    Registered User
    Join Date
    11-22-2013
    Location
    Islamabad
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Filtering fonction

    Using Auto Filter to filter data is a quick and easy way to find and work with a subset of data in a range of cells or table. Once you have filtered data in a range of cells or table, you can either reapply a filter to get up-to-date results, or clear a filter to redisplay all of the data.

+ 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. Chaining IF Fonction
    By Born2Fly in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-06-2013, 04:58 PM
  2. if,match fonction
    By s_zabihi in forum Excel General
    Replies: 1
    Last Post: 12-01-2011, 06:20 PM
  3. [SOLVED] Le dialogue de fonction d'excel appel ma fonction "user defined"
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2006, 10:30 PM
  4. Help with max() fonction
    By anyways in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-22-2006, 12:46 PM
  5. =FONCTION(CELLULE(A1)) ?
    By Olivier SOW in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2005, 05:05 AM

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