+ Reply to Thread
Results 1 to 5 of 5

count cells that contain part of text

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Magyarország
    MS-Off Ver
    Excel 2010
    Posts
    2

    count cells that contain part of text

    Hi,

    I want to use the COUNTIF formula to count the number of cells that contain a text (that is written in a cell). Let me explain, my cells are:

    John, Jack
    John
    Mary
    Jack

    Now I want to count the cells that contain the word Jack (I want 2 to be displayed). My problem is that I want I want to refer to it as a cell, not as a text. So instead of using =COUNTIF(A1:A4;"*Jack*"), I want to use something like =COUNTIF(A1:A4;(B1)), provided that cell B1 contains the word that I'm looking for (Jack). The problem is that this way I can't use the * because =COUNTIF(A1:A4;*(B1)*) does not seem to work.

    I hope I was clear.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: count cells that contain part of text

    How about:

    =COUNTIF(A1:A4,"*" & B1 & "*")

  3. #3
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: count cells that contain part of text

    You use the & to combine txt and cell references.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please click the * icon below if I have helped.

  4. #4
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: count cells that contain part of text

    Melvin was quicker on the post then me
    Please Login or Register  to view this content.
    Last edited by Chance2; 01-23-2013 at 05:57 PM. Reason: dupe post

  5. #5
    Registered User
    Join Date
    01-23-2013
    Location
    Magyarország
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: count cells that contain part of text

    Quote Originally Posted by Andrew-R View Post
    How about:

    =COUNTIF(A1:A4,"*" & B1 & "*")
    Thank you for all of you. Works like a charm

+ 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