+ Reply to Thread
Results 1 to 10 of 10

Finding/counting a given character within a cell

Hybrid View

  1. #1
    David Biddulph
    Guest

    Re: Finding/counting a given character within a cell

    "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    news:4485AFFB.279A3B55@verizonXSPAM.net...

    > Bob wrote:
    >>
    >> For a given cell, I need to count the number of times a given character
    >> (e.g., the letter "a") appears. Is there a worksheet function or formula
    >> that will help me do this? Thanks for any help.


    > =(LEN(A1)-LEN(SUBSTITUTE(LOWER(A1),lower("a"),"")))/LEN("a")
    > Will count the number of A's or a's in A1.
    >
    > If you want just the lower case a's:
    > =(LEN(A1)-LEN(SUBSTITUTE(A1,"a","")))/LEN("a")


    What is the division by LEN("a") doing? Isn't LEN("a") equal to 1?
    --
    David Biddulph



  2. #2
    Kevin Vaughn
    Guest

    Re: Finding/counting a given character within a cell

    I think you're right. It looks like the /1 is not needed.

    --
    Kevin Vaughn


    "David Biddulph" wrote:

    > "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    > news:4485AFFB.279A3B55@verizonXSPAM.net...
    >
    > > Bob wrote:
    > >>
    > >> For a given cell, I need to count the number of times a given character
    > >> (e.g., the letter "a") appears. Is there a worksheet function or formula
    > >> that will help me do this? Thanks for any help.

    >
    > > =(LEN(A1)-LEN(SUBSTITUTE(LOWER(A1),lower("a"),"")))/LEN("a")
    > > Will count the number of A's or a's in A1.
    > >
    > > If you want just the lower case a's:
    > > =(LEN(A1)-LEN(SUBSTITUTE(A1,"a","")))/LEN("a")

    >
    > What is the division by LEN("a") doing? Isn't LEN("a") equal to 1?
    > --
    > David Biddulph
    >
    >
    >


  3. #3
    Dave Peterson
    Guest

    Re: Finding/counting a given character within a cell

    Yep.

    But anyone who uses google may want to find the number of times "David" appears
    in a cell.

    Then the formula is easily changed--it's kind of self documenting.



    David Biddulph wrote:
    >
    > "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    > news:4485AFFB.279A3B55@verizonXSPAM.net...
    >
    > > Bob wrote:
    > >>
    > >> For a given cell, I need to count the number of times a given character
    > >> (e.g., the letter "a") appears. Is there a worksheet function or formula
    > >> that will help me do this? Thanks for any help.

    >
    > > =(LEN(A1)-LEN(SUBSTITUTE(LOWER(A1),lower("a"),"")))/LEN("a")
    > > Will count the number of A's or a's in A1.
    > >
    > > If you want just the lower case a's:
    > > =(LEN(A1)-LEN(SUBSTITUTE(A1,"a","")))/LEN("a")

    >
    > What is the division by LEN("a") doing? Isn't LEN("a") equal to 1?
    > --
    > David Biddulph


    --

    Dave Peterson

+ 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