+ Reply to Thread
Results 1 to 9 of 9

Count Cells that contain specific text

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    Gladstone
    MS-Off Ver
    Excel 2010
    Posts
    3

    Count Cells that contain specific text

    I am trying to count a list of keywords and return the specific value in a certain cell.

    excel sample.gif

    So if the cell A3 contains the word relief teaching, the value in B3 is moved into the cell C3.

    Does anyone know the formulae for this?

    Your help is greatly appreciated.

    Bob

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Count Cells that contain specific text

    hi Bob, welcome to the forum & a Happy New Year to you. try this in C2:
    =IF(ISNUMBER(SEARCH(C$1,$A2)),$B2,"")

    next time though, do upload a sample Excel file instead. it helps us to test more easily

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count Cells that contain specific text

    Try this...

    Entered in C2:

    =IF(COUNT(SEARCH(" "&C$1&" "," "&$A2&" ")),$B2,"")

    Copy across as far as needed then down as far as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count Cells that contain specific text

    =IF(ISNUMBER(SEARCH(C$1,$A2)),$B2,"")
    That will fail on these entries:

    relief teacher
    relief teachers

    It will find "relief teacher" in "relief teachers".

  5. #5
    Registered User
    Join Date
    12-31-2012
    Location
    Gladstone
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Count Cells that contain specific text

    Of course. I am such a dope.

    Attached is the file.

    This is keyword data from my website.

    I need to identify which key words are most significant.

    I want to count the number of times a phrase (eg, relief teaching) occurs.

    So I need to formula to identify is the phrase exist, then it copies the value of the the cell into the correct column.

    So the formula in c3 should return a value = b3 if a3 contains the phrase "relief teaching"

    Likewise the formula in d3 should return a value = b3 is a3 contains the phrase "relief teacher"

    I have attached the file as a link.

    I hope this is OK.

    Happy New Year to you too.

    Bob

    http://www.reliefteaching.com/blog/keywords.xlsx

  6. #6
    Registered User
    Join Date
    12-31-2012
    Location
    Gladstone
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Count Cells that contain specific text

    That does the trick Tony.

    Thank you.

    Bob

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count Cells that contain specific text

    You're welcome. Thanks for the feedback!

  8. #8
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Count Cells that contain specific text

    Quote Originally Posted by Tony Valko View Post
    Try this...

    Entered in C2:

    =IF(COUNT(SEARCH(" "&C$1&" "," "&$A2&" ")),$B2,"")

    Copy across as far as needed then down as far as needed.
    Your formula fail on "reliefteaching.com" . It is the same as "relief teaching". See the row 9 of the OP attachment on post #5.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Count Cells that contain specific text

    I didn't download that file but based my suggestion on the screencap in post #1. In post #6 the OP seems satisfied.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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