+ Reply to Thread
Results 1 to 9 of 9

true or false if columns contain certain words

  1. #1
    Registered User
    Join Date
    11-26-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    true or false if columns contain certain words

    Heya guys

    I am stuck with a small problem.

    I have a spreadsheet with a few rows that contain data.

    I want to pick out the rows that contain certain keywords.

    So for instance column A and B contain free text, I want to pick out the rows that contain certain words (example: Gunslinger, assassin, tank)
    I want to have a formula that will update another column with a 0 if no matches are found or with a 1 if there is a match on any of the words.

    Howon earth would I go about doing it?

  2. #2
    Registered User
    Join Date
    08-22-2012
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: true or false if columns contain certain words

    Hi pgds,
    try solution from attached file....

    Regards,
    If a post helps press star sign 4 my reputation

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

    Re: true or false if columns contain certain words

    If the column contains more than the key word (i.e. "I am a gunslinger")
    Try this arrayed formula (enter with CNTRL SHFT ENTER. {} will appear around formula if done properly)

    =SUM(--ISNUMBER(SEARCH($J$1:$J$3,A1)))
    where J1:J3 contain your keywords
    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
    Registered User
    Join Date
    11-26-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: true or false if columns contain certain words

    woah, thanks guys

    I am gonna give this a try and report back in a bit. Just waiting for my query to finish before I can attempt this

  5. #5
    Registered User
    Join Date
    11-26-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: true or false if columns contain certain words

    Quote Originally Posted by ChemistB View Post
    If the column contains more than the key word (i.e. "I am a gunslinger")
    Try this arrayed formula (enter with CNTRL SHFT ENTER. {} will appear around formula if done properly)

    =SUM(--ISNUMBER(SEARCH($J$1:$J$3,A1)))
    where J1:J3 contain your keywords
    Does that work for you?
    hmm.. not sure its working right, look at the screenshot

    formula.png

  6. #6
    Registered User
    Join Date
    08-22-2012
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: true or false if columns contain certain words

    pgds,
    what are you doing? My and ChemistB's answer is not connected. I attached file with a final solution in case that you have exact word looking for in A or B column. ChemistB just gave you idea for solution if you have sentence including word looking for. His sample is referenced to range in J column and no any common junction with my sample....
    Please carefuly study formulas I put in column C in my sample...
    My solution is not need array notification...
    Regards,

  7. #7
    Registered User
    Join Date
    11-26-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: true or false if columns contain certain words

    Quote Originally Posted by mnjofra View Post
    pgds,
    what are you doing? My and ChemistB's answer is not connected. I attached file with a final solution in case that you have exact word looking for in A or B column. ChemistB just gave you idea for solution if you have sentence including word looking for. His sample is referenced to range in J column and no any common junction with my sample....
    Please carefuly study formulas I put in column C in my sample...
    Regards,
    No wonder I am confused, ok maybe if I explain a little more.

    I actually have 4 columns, the 1st column I can ignore, then there are 3 with various sentences of text. if any of my keywords appear in any of those sentences then I need a marker (1) if not then (0)

    Attached is a sample of my spreadsheet if it helps. How can I sort this?

    sample.xlsx

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

    Re: true or false if columns contain certain words

    I entered a modified Arrayed formula in Column E
    In E2
    =(SUM(--ISNUMBER(SEARCH($J$2:$J$4,B2:D2)))>0)+0
    Is that what you are looking for?
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-26-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: true or false if columns contain certain words

    Quote Originally Posted by ChemistB View Post
    I entered a modified Arrayed formula in Column E
    In E2
    =(SUM(--ISNUMBER(SEARCH($J$2:$J$4,B2:D2)))>0)+0
    Is that what you are looking for?
    Rock n Roll!!

    thank you very much

+ 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