+ Reply to Thread
Results 1 to 4 of 4

Count number of instances of a character in a column of cells

  1. #1
    Registered User
    Join Date
    02-09-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    4

    Count number of instances of a character in a column of cells

    Hi,

    The second part of my previous question (http://www.excelforum.com/excel-gene...le-string.html) is how can I count the number of instances of a character in a column of cells?

    eg.

    Alpha
    Bravo
    Charlie
    Delta
    Echo

    Answer

    A = 5
    B = 1
    ...
    Z = 0

    Again, ideally each letter will be calculated using a single formula without a macro. I only need an example for letter A, I can fill out the rest of the alphabet.

    I appreciate all your help in advance!

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Count number of instances of a character in a column of cells

    For a count of "a" or "A" in A1:A10 try

    =SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(LOWER(A1:A10),"a","")))
    Audere est facere

  3. #3
    Registered User
    Join Date
    02-09-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Count number of instances of a character in a column of cells

    Great thanks, exactly what I needed!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Count number of instances of a character in a column of cells

    Hi

    I got this from 1 of the genius members on here (wish I remembered their name)

    With your data in column A, create a list of the alphabet in a column (I used E), then next to the letters, use this, copied down...
    =SUM((LEN($A$2:$A$101)-LEN(SUBSTITUTE(UPPER($A$2:$A$101),E2,""))))
    it is an array formula and must be entered using CTRL SHIFT enter. not just enter
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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