+ Reply to Thread
Results 1 to 15 of 15

Thread: Filter based on Unique occurrences of Text

  1. #1
    Registered User
    Join Date
    12-26-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    12

    Filter based on Unique occurrences of Text

    in Excel 2007 I am trying to analyze a corpus datasheet which has 128220 rows, 4 column. The Column Headings are LOCATION, FORM, TAG and FEATURES. There is no problem with the first 3 column since they contain single text, but the FEATURES column contains text with many words. Look at the row of the sheet:

    [(1:6:1:1)] [{hodi] [V] [STEM|POS:V|IMPV|LEM:hadaY|ROOT:hdy|2MS]


    My question is is it possible to filter the rows based on the unique occurrence of the ROOT (from the example above and the xcel file given below)? I mean, there are many rows with the root hdy, but I need only one. In other words, my filtered sheet (separate) would include only those rows with unique occurrence of a root.

    Can anyone please help me do this job? What would be the criteria for this? If done in Access, how is that?
    Please simplify your answer as much as possible, because I am a biginner in Excel.

    Here is the file (71 kb) link. The file was lightened for your convenience.

  2. #2
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,403

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Hi mfhaq77,

    Would it be possible for you to attach the file under this thread.. while replying, click on "go advanced" and look out for paper clip icon to attach. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    12-26-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Quote Originally Posted by dilipandey View Post
    Hi mfhaq77,

    Would it be possible for you to attach the file under this thread.. while replying, click on "go advanced" and look out for paper clip icon to attach. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Here is the file
    All verbs Unique Roots.xlsx

  4. #4
    Registered User
    Join Date
    12-26-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Have you got the file attached here?

  5. #5
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,403

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Hi mfhaq77,

    Yes, I got the file.
    I managed to get the root extracted in column E, See the attached file, and now my question is for root hdy, you have 3 entries and for every entry, column A has different location, now which one row you want to filter out ? or it would be any one row out of these 3? Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Attached Files Attached Files
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  6. #6
    Registered User
    Join Date
    12-26-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Quote Originally Posted by dilipandey View Post
    Hi mfhaq77,

    Yes, I got the file.
    I managed to get the root extracted in column E, See the attached file, and now my question is for root hdy, you have 3 entries and for every entry, column A has different location, now which one row you want to filter out ? or it would be any one row out of these 3? Thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    You misunderstood me. Hdy should be taken only once. I want those rows with unique occurrence of other Roots. Other rows will be left out. ........................amnd so on. Location is not the matter, the whole row is needed
    Last edited by mfhaq77; 02-12-2012 at 11:44 AM.

  7. #7
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,403

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Ok... so do you need any one from the rows 2, 1466, 1486 from the sheet1 in the workbook I attached in post #5 ?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  8. #8
    Registered User
    Join Date
    12-26-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    After discarding rows with duplicate roots, there will be , I assume, 300 rows left but how will i do that......

  9. #9
    Valued Forum Contributor
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and reluctantly Excel 2007
    Posts
    631

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Using dilipandey's solution to extract unique values I've added a macro that extracts and then deletes rows with duplicate values. Is this what you are looking fore?

    To test run macro "sort_data".

    Alf

    Ps Any credit for solving this should go to dilipandey
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    12-26-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Quote Originally Posted by Alf View Post
    Using dilipandey's solution to extract unique values I've added a macro that extracts and then deletes rows with duplicate values. Is this what you are looking fore?

    To test run macro "sort_data".

    Alf

    Ps Any credit for solving this should go to dilipandey
    If there are 4 letters in the ROOT, will this macro be applicable?

  11. #11
    Valued Forum Contributor
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and reluctantly Excel 2007
    Posts
    631

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    If there is 4 letters in the root instead of 3 the line

    Range("E2").Formula = "=Mid(D2,Search(""root"",D2)+5,3)"
    should be changed to:

    Range("E2").Formula = "=Mid(D2,Search(""root"",D2)+5,4)"
    What I do wonder about is lines like this:

    (2:31:10:1) >an[bi_#u V STEM|POS:V|IMPV|(IV)|LEM:>an[ba>a|ROOT:nbA|2MP
    (2:33:3:1) >an[bi}o V STEM|POS:V|IMPV|(IV)|LEM:>an[ba>a|ROOT:nbA|2MS
    where both got the same "root" value "nbA" but one has "2MP" and the other "2MS" at the end. Should they be taken as duplicate values or are they unique?

    Alf

  12. #12
    Registered User
    Join Date
    12-26-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    we will just consider Roots, not other elements. For the case of "nba" one of them is enough. Note that the Vertical line is the boundary, not a character to be included. Frame a formula in such a way that any number of letters after the : and before the Vertical line is included in search result. In your last solution the Vertical line was also included like nbA| ........

  13. #13
    Valued Forum Contributor
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and reluctantly Excel 2007
    Posts
    631

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    That's because you asked for 4 letters in the root so in those cases where there only are 3 letters in the root you will get the 3 letters + the | char. Does it matters? I got the impression you only wanted the rows with unique roots?

    Alf

  14. #14
    Registered User
    Join Date
    12-26-2011
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Yes matters. I want the root letters only , not that vertical lines

  15. #15
    Valued Forum Contributor
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and reluctantly Excel 2007
    Posts
    631

    Re: Please help Filter Rows based on Unique occurrence of Text in a huge datasheet

    Ok no problem.

    This macro cuts a string of 4 letters. It then checks if there is a | in the string (when root value is 3 letters)and removes it. If it's 4 letters in the root value then there is no | and no action is taken.

    Alf
    Attached Files Attached Files

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