+ Reply to Thread
Results 1 to 12 of 12

Sorting rows on whether they contain a specific string

  1. #1
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Sorting rows on whether they contain a specific string

    Lets say I have a 2 column sheet (A and B). And I want to sort on column B with all the rows that contain a given string, i.e. /g or Δείτε.

    Something like doing a find all but then being able to select/copy/cut etc those rows.

    How can this be done?
    Last edited by greek; 09-08-2009 at 02:05 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sorting rows on whether they contain a specific string

    Use col C. In the header row (C1?), enter the phrase to find.

    In C2 and down, write a SEARCH or FIND formula to look for C1 in the adjacent B cell. Sort by col C.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Re: Sorting rows on whether they contain a specific string

    Thanks, what would the search formula syntax be like?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sorting rows on whether they contain a specific string

    In C2 and down, =ISNUMBER(SEARCH(C$1, B2))

  5. #5
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Re: Sorting rows on whether they contain a specific string

    Cool, thanks! Works like magic. Is there a way to add an "or" argument? Say, if the word is x or y then it should be TRUE.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sorting rows on whether they contain a specific string

    =or(isnumber(...), isnumber(...), ...)

  7. #7
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Re: Sorting rows on whether they contain a specific string

    Tried these:

    Please Login or Register  to view this content.
    but did not work. I added the second word in D1 cell.

    This works for one word:

    =ISNUMBER(SEARCH(C$1;B2))

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sorting rows on whether they contain a specific string

    OR is a function

    All functions in Excel are followed by an open paren, their arguments, and a closing paren.

    Open and close parens must balance (which follows from the above)

  9. #9
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Re: Sorting rows on whether they contain a specific string

    Thanks. I thought I had closed them all in the second instance, kindly clarify as I am not sure what needs to change.

    =ORISNUMBER(SEARCH(C$1;B2)), ISNUMBER(SEARCH(D$1;B2))

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sorting rows on whether they contain a specific string

    Should be

    =OR(ISNUMBER(SEARCH(C$1;B2));ISNUMBER(SEARCH(D$1;B2)))
    Where there is a will there are many ways.

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

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

  11. #11
    Forum Contributor
    Join Date
    06-09-2009
    Location
    Greece
    MS-Off Ver
    Office 365
    Posts
    133

    Re: Sorting rows on whether they contain a specific string

    Many thanks, much indebted to you for your kind help.

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sorting rows on whether they contain a specific string

    Please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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