+ Reply to Thread
Results 1 to 6 of 6

filtering rows BUT order of columns does not matter

  1. #1
    Registered User
    Join Date
    03-10-2011
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    3

    filtering rows BUT order of columns does not matter

    hey everybody!

    I have a table of values that represent the connections of some neurons.
    but in this table each connection is saved as send AND receive connection.
    so if A and B are connected, I have two etries in my table:
    A B
    B A

    what I want to do is to get rid of one of these two entries. but I do not know how - all the posts that I found around the internet only say how to delete duplicate entries like
    A B
    A B

    can someone please explain to me how to get rid of duplicate rows where the order of the colums does not matter (like I described in the example above)?

    thanks,
    Johannes
    Last edited by jaronimo; 03-16-2011 at 10:00 AM.

  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: filtering rows BUT order of columns does not matter

    Assuming columns A & B have the data:

    1) Put this formula in C1 and copy the cell down the whole dataset:
    =A1&"-"&B1

    2) Put this formula in D1 and copy down:
    =B1&"-"&A1

    3) Put this formula in E1 and copy down:
    =COUNTIF($D$1:$D1,$C1)


    A series of 0s and 1s (and possibly more) will appear.

    4) Sort the entire set of data A:E descending by column E. This will put the dupes at the top.

    5) Select all the rows with 1 and delete them all at once.
    _________________
    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
    Registered User
    Join Date
    03-10-2011
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: filtering rows BUT order of columns does not matter

    thank you for your help!
    I tried your suggested method but excel keeps telling me that there's an error in the last formula..
    since I'm not that experienced in excel, I'm not really able to debug it myself.

    for clearyfication I attached the file that I try to filter.

    thanks again,
    Johannes
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: filtering rows BUT order of columns does not matter

    Hi,

    I'm just forwarding in the file attached the JBeaucaire's solution.

    Regards
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-10-2011
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: filtering rows BUT order of columns does not matter

    awesome, thanks!

    I don't know why my attempt did not work..

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

    Re: filtering rows BUT order of columns does not matter

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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