+ Reply to Thread
Results 1 to 4 of 4

Counting a specific character string in a range of cells.

Hybrid View

  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
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,539

    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!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    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
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,539

    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)

Similar Threads

  1. [SOLVED] counting instances of a character within a string
    By mikelee101 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-15-2019, 05:28 AM
  2. [SOLVED] VBA Find String before specific character in string
    By Catsonheat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-25-2019, 07:31 AM
  3. [SOLVED] Counting Cells with Particular Character or String value
    By anir_sarkar1 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-20-2013, 08:36 AM
  4. I am trying to truncate cells in a column from a specific character in a string
    By goldbeje in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-27-2012, 09:20 PM
  5. [SOLVED] I am trying to truncate cells in a column from a specific character in a string
    By goldbeje in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2012, 11:31 AM
  6. Replies: 3
    Last Post: 04-17-2010, 05:02 AM
  7. Replies: 1
    Last Post: 09-12-2005, 01:05 PM

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