+ Reply to Thread
Results 1 to 3 of 3

Count how many times a letter occurs

  1. #1
    Registered User
    Join Date
    03-15-2009
    Location
    USA, Texas
    MS-Off Ver
    Excel 2007
    Posts
    13

    Count how many times a letter occurs

    I want to count the occurrence of certain letters in a range of cells. In my attachment I need the sum of how many times the letters "C,M,Y,K" occur in the range A2:D2.
    Attached Files Attached Files
    Last edited by GreenMartian; 03-15-2009 at 12:57 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Count how many times a letter occurs

    How about a simple:

    =COUNTIF(A2:D2,"*Y*")+COUNTIF(A2:D2,"*C*")+COUNTIF(A2:D2,"*M*")+COUNTIF(A2:D2,"*K*")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Count how many times a letter occurs

    The below:

    =SUM(COUNTIF(A2:D2,{"*C*","*M*","*K*","*Y*"}))

    Is the same as JB's only using an inline array constant & SUM - ie saves you have to write out the COUNTIF multiple times.

+ 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