+ Reply to Thread
Results 1 to 9 of 9

To search Keywords

  1. #1
    Forum Contributor
    Join Date
    08-12-2012
    Location
    mysore
    MS-Off Ver
    Excel 2007
    Posts
    212

    To search Keywords

    I need to extract some data from the column based on matching keywords.
    Let me know any easy steps.

    Names with…
    911
    EMS
    Security
    Police
    PD (ending in)
    FD (ending in)
    Fire
    Emergency
    Safety
    Parole
    Criminal
    Justice
    Ambulance
    Medic
    Paramedic
    Sherriff
    Probation
    Sheriff
    Detention
    Dispatch
    Patrol
    Prison
    Jail

    Thanks

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: To search Keywords

    Set up AutoFilter on the column using the Contains... option.

    Then list your keywords.

    See:

    http://www.contextures.com/xlautofilter01.html
    Gary's Student

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: To search Keywords

    Let's put your list in J1:J21 (except for the criteria about endings) and your data starts in A2 going down
    In B2 enter this array formula (Array formulas require using CNTRL SHFT ENTER instead of ENTER. You'll see {} around your formula if done properly)

    =SUM(--ISNUMBER(SEARCH($J$1:$J$21,A2)))+ OR(RIGHT(A2,2)={"PD","FD"})
    dragged down. Then filter on column B > 0
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor
    Join Date
    08-12-2012
    Location
    mysore
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: To search Keywords

    Getting zero for everything.

    Thanks

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: To search Keywords

    ChemistB's formula was an array formula
    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Contributor
    Join Date
    08-12-2012
    Location
    mysore
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: To search Keywords

    Copy pasting the formula and then hitting CRL+SHT+ENTR

    But not working.

    Thanks

  7. #7
    Forum Contributor
    Join Date
    08-12-2012
    Location
    mysore
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: To search Keywords

    =SUM(--ISNUMBER(SEARCH($J$1:$J$21,A3)))+ OR(RIGHT(A3,2)={"PD","FD"})

    and entering crl sht entr but not working/

    Attaching sample worksheet.
    Thanks
    Attached Files Attached Files

  8. #8
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: To search Keywords

    Here is your sample filled in.
    Attached Files Attached Files

  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: To search Keywords

    non array version
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    "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

+ 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