+ Reply to Thread
Results 1 to 8 of 8

What FORMULA will count records that CONTAIN certain text?

  1. #1
    jfrisch3
    Guest

    What FORMULA will count records that CONTAIN certain text?

    I have a survey that allows mulitple answers. What formula can I use to
    count the records that contain certain text? I can Filter the responses for
    those records that contain the data, but I want to use a formula instead.

  2. #2
    CLR
    Guest

    RE: What FORMULA will count records that CONTAIN certain text?

    =COUNTIF(range,criteria)

    Vaya con Dios,
    Chuck, CABGx3



    "jfrisch3" wrote:

    > I have a survey that allows mulitple answers. What formula can I use to
    > count the records that contain certain text? I can Filter the responses for
    > those records that contain the data, but I want to use a formula instead.


  3. #3
    Registered User
    Join Date
    03-31-2006
    Posts
    27

    Count IF

    Lets say you have the following in cells A1:A10
    Apple
    PeachApple
    Pear
    Apple
    ApplePeach
    Pear
    Apple
    Peach
    PearApple
    AppleApple

    You want to count those cells that contain the text Apple - so you want the result to be 7.

    Type =SUM(IF(ISERROR(SEARCH("Apple",A1:A10))=FALSE,1,0))
    and then click inside your formula bar and press Ctrl+Shift+Enter to make this an array formula.

    Regards,
    Michael.
    http://www.excelexchange.com
    Last edited by michael.a7; 04-01-2006 at 04:49 PM.

  4. #4
    Registered User
    Join Date
    07-17-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    3

    Smile Re: What FORMULA will count records that CONTAIN certain text?

    Thank you, thank you, thank you! This formula performs beautifully where many of the others I researched failed. The simplicity of it is fantastic and the fact that it works tireless is a bonus! Thank you so very much!

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: What FORMULA will count records that CONTAIN certain text?

    Simpler to use wildcards with COUNTIF like this

    =COUNTIF(A1:A10,"*Apple*")
    Audere est facere

  6. #6
    Registered User
    Join Date
    07-17-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: What FORMULA will count records that CONTAIN certain text?

    Quote Originally Posted by daddylonglegs View Post
    Simpler to use wildcards with COUNTIF like this

    =COUNTIF(A1:A10,"*Apple*")
    daddylonglegs -

    Thanks for your response. Although I definitely see the benefit of using your formula, I like the other one better for several reasons: I don't like typing in the exact text into the formula that I am trying to find.

    For ease of using the same example, here's what I mean:
    I typed the word Apple into cell O17 in my sheet, then I changed the formula to be O17 instead of "Apple".
    Former example: SUM(IF(ISERROR(SEARCH("Apple",A1:A10))=FALSE,1,0))
    New Example: SUM(IF(ISERROR(SEARCH(O17,A1:A10))=FALSE,1,0))

    That way, if I change the text I'm looking for in cell O17 from "Apple" to "Apples", or any other terminology (Oranges, Lemons, etc.), the formulas still work w/out any additional changes to the formula.

    Thanks!

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: What FORMULA will count records that CONTAIN certain text?

    .....Well that will work with COUNTIF too......

    =COUNTIF(A1:A10,"*"&O17&"*")

  8. #8
    Registered User
    Join Date
    07-17-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: What FORMULA will count records that CONTAIN certain text?

    Ahh! I like it! Thank you!

+ 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