+ Reply to Thread
Results 1 to 4 of 4

Counting a specific character string in a range of cells.

  1. #1
    Registered User
    Join Date
    12-06-2018
    Location
    Norway
    MS-Off Ver
    1811
    Posts
    31

    Counting a specific character string in a range of cells.

    Hello,

    I've attached a sample of my work. I would like to count the number of cells having the character string "no DNA-profile". I've been using the formula as explained in another post, which generic is: =SUMPRODUCT(LEN(rng)-LEN(SUBSTITUTE(rng,txt,""))).

    However, that has not worked correctly for me as shown in cell B1, where the count should be 1 instead of 14.

    Can somebody help me with this issue? Hope this question is still interesting!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2019 (Win 10 - Work) & 365 Subscription Insider (Win 10 - Home)
    Posts
    34,175

    Re: Counting a specific character string in a range of cells.

    You can use a simple COUNTIF for this:

    =COUNTIF($A$1:$A$8,"no DNA-profile")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    1,926

    Re: Counting a specific character string in a range of cells.

    Try this: =SUMPRODUCT((LEN(rng)-LEN(SUBSTITUTE(rng,txt,"")))/LEN(txt))
    Click the * to say thanks.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2019 (Win 10 - Work) & 365 Subscription Insider (Win 10 - Home)
    Posts
    34,175

    Re: Counting a specific character string in a range of cells.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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