+ Reply to Thread
Results 1 to 5 of 5

Help on a function to count

  1. #1
    Registered User
    Join Date
    03-05-2009
    Location
    Channahon, IL
    MS-Off Ver
    Excel 2003
    Posts
    2

    Help on a function to count

    Can someone tell me if there is a function that will lookup all similiar text within a cell even if the cell contains other data within the cell.

    example.

    Lets say, Column A contains the names, ages and location of over 200 people, and I wanted to count how many people in the column are 35 years of age.

    Data all looks like this.

    Jeff Jones, 35, San Diego, CA

    Can this be done?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help on a function to count

    Try Countif()

    e.g. =COUNTIF(A1:A9,"*"&35&"*")

    adjust range to suit.

    You can replace 35 with a cell reference containing the age too.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-05-2009
    Location
    Channahon, IL
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Help on a function to count

    Quote Originally Posted by overworked View Post
    Can someone tell me if there is a function that will lookup all similiar text within a cell even if the cell contains other data within the cell.

    example.

    Lets say, Column A contains the names, ages and location of over 200 people, and I wanted to count how many people in the column are 35 years of age.

    Data all looks like this.

    Jeff Jones, 35, San Diego, CA

    Can this be done?
    Quote Originally Posted by NBVC View Post
    Try Countif()

    e.g. =COUNTIF(A1:A9,"*"&35&"*")

    adjust range to suit.

    You can replace 35 with a cell reference containing the age too.

    Thank you.

    Does the formula change if you want to count how many people are from CA? compared to NV or OR.

    example Jeff Jones, 35, San Diego, CA

    I put in =Countif(A2:I26;"*"&CA&"*") but it is not returning anything?

    any input would be appreciated.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help on a function to count

    =COUNTIF(A1:A26,"*ca*")
    but that would also count cathy!!
    "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

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Help on a function to count

    As Martin says you need to reduce possibility of errors, if State is preceded with a comma and is always at the end of the string then perhaps:

    =COUNTIF(A1:A26,"*, CA")

+ 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