+ Reply to Thread
Results 1 to 5 of 5

FORMULA NEEDED: determine cell value in part by searching key words in other cells, sheets

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    Burnaby, BC
    MS-Off Ver
    Excel 2010
    Posts
    29

    Exclamation FORMULA NEEDED: determine cell value in part by searching key words in other cells, sheets

    Hello Friends:

    I'm working with a large database of 200,000+ rows of timecard entries. When employees log time to "Training" our system does not provide them with options to differentiate various types of training, so the employees add notes to help clarify. What I need to do is look for "Training" entries, then parse the "Notes" field of those entries for terms in a key word list I created on a separate sheet. Depending on which terms are found in the "Notes" field, the "Training" entries are given a "Category" value.

    I've attached an example file. In the simplified scenario attached, I only need 2 different categories: "Good" and "Bad". I'm assuming I should use a formula combining IF with INDEX, MATCH or LOOKUP, but it's a bit beyond my skills at the moment, and time is of the essence so I'm reaching out for help.

    Any guidance that can be provided will be MUCH appreciated!

    Thanks!
    Attached Files Attached Files
    Last edited by PWM; 03-23-2014 at 10:01 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: FORMULA NEEDED: determine cell value in part by searching key words in other cells, sh

    Put this array* formulae in cell G2:

    =IF(SUM(IF(ISNUMBER(SEARCH(Sheet2!A$2:A$15,F2)),1,0))>0,"Good","Bad")

    It should copy down automatically.

    *NOTE: an array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE), rather than the usual <Enter>.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    02-25-2014
    Location
    Burnaby, BC
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: FORMULA NEEDED: determine cell value in part by searching key words in other cells, sh

    Quote Originally Posted by Pete_UK View Post
    Put this array* formulae in cell G2:

    =IF(SUM(IF(ISNUMBER(SEARCH(Sheet2!A$2:A$15,F2)),1,0))>0,"Good","Bad")

    It should copy down automatically.

    *NOTE: an array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE), rather than the usual <Enter>.

    Hope this helps.

    Pete
    Thanks so much, Pete! It appears to do what I need. I just have to translate it to the more complex context of the actual database. I notice that curly brackets appear around the formula now - is that because it's an array formula? I don't really understand the formula you sent, but I'd really like to. Could you break it down for me very briefly? Or perhaps point me to a resource that might help me learn more? Again, many thanks for your quick reply!! I'll be clicking Add Reputation BTW!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: FORMULA NEEDED: determine cell value in part by searching key words in other cells, sh

    Yes, the curly braces are put in by Excel when you do CSE - you do not type them yourself.

    The array in question is A2:A15 on sheet2, and the formula will cycle through each of those cells in turn. The function SEARCH looks to see if A2 of Sheet2 is contained within cell F2 - if it is, then 1 will be added on to a cumulative sum, otherwise zero. This will continue through the cells of that array, so that at the end if the SUM is greater than zero then there was at least one cell from that array that matched part of F2. If the SUM is zero then there were no matches, so return the appropriate phrase/word.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    02-25-2014
    Location
    Burnaby, BC
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: FORMULA NEEDED: determine cell value in part by searching key words in other cells, sh

    Quote Originally Posted by Pete_UK View Post
    Yes, the curly braces are put in by Excel when you do CSE - you do not type them yourself.

    The array in question is A2:A15 on sheet2, and the formula will cycle through each of those cells in turn. The function SEARCH looks to see if A2 of Sheet2 is contained within cell F2 - if it is, then 1 will be added on to a cumulative sum, otherwise zero. This will continue through the cells of that array, so that at the end if the SUM is greater than zero then there was at least one cell from that array that matched part of F2. If the SUM is zero then there were no matches, so return the appropriate phrase/word.

    Hope this helps.

    Pete
    Yes, thanks very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 02-03-2013, 06:25 PM
  2. Searching for multiple words in a cell
    By CU2011 in forum Excel General
    Replies: 12
    Last Post: 05-05-2011, 11:48 AM
  3. Searching text in cells for words
    By pwdunn in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-18-2008, 05:12 PM
  4. searching only part of the values in a cell
    By saziz in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-29-2008, 09:03 PM
  5. Searching for words in cells
    By SEAEngineer in forum Excel General
    Replies: 3
    Last Post: 08-17-2007, 01:52 PM

Tags for this Thread

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