+ Reply to Thread
Results 1 to 6 of 6

COUNTIF with partial match?

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    Posts
    3

    COUNTIF with partial match?

    Hi

    I have a column with a different alphanumeric strings in each cell. Some of these values have a portion that is common. For e.g.:

    Example kealey 1980
    Testing
    Reference
    Example john commission
    Example (hard sell)

    Is there a formula to return the number of cells that have "Example" in them?
    Last edited by kaydee; 11-03-2008 at 10:08 AM. Reason: solved

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    =COUNTIF(range,"Example*")

    assuming you don't want to find

    testing Example testing

    if you do:

    =COUNTIF(range,"*Example*")

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    Posts
    3

    Doesn't work

    Thank you, but I already tried this. Sorry - I think my example was not accurate.

    Actually the common factor here is a number (1980) at the beginning. When applied, this formula does not count cells which only have "1980". So, for

    1980 kealey
    Testing
    Reference
    1980 john commission
    1980
    1980 (hard sell)

    it returns a count of 3 while I want it to be 4.

    Sorry for confusion

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    Given mixed data types (text and numerics) you could use something like:

    =SUMPRODUCT(--(ISNUMBER(SEARCH("1980",A1:A6))))

    or combine 2 Countif's

    =COUNTIF(A1:A6,"*1980*")+COUNTIF(A1:A6,1980)

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Try this it will count TEXT and NUMBERS

    =COUNTIF(A1:A6,"*1980*")+COUNTIF(A1:A6,1980)
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    Posts
    3

    [solved]

    Both worked but I used the SUMPRODUCT function!

    Thanks to both of you for taking the time to respond, and sorry for not being clear enough in the first post.

+ 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