+ Reply to Thread
Results 1 to 4 of 4

Counting the number of letters in a cell

  1. #1
    Registered User
    Join Date
    11-11-2004
    Posts
    2

    Question Counting the number of letters in a cell

    Can Excel count the numbers of letters in a cell that has mixed letters and numbers? Can you restrict =LEN to only letters (or only numbers)?

    IE - ABC123
    # of letters = 3

    Thanks,
    Adam

  2. #2
    Forum Contributor
    Join Date
    04-11-2005
    Location
    London
    Posts
    259
    Are they always in the same format Adam? ie 3 letters, 3 numbers. If they are try a combination of the LEFT and LEN functions.

    ie =LEN(LEFT(A1)) etc.

    If the pattern is irregular, yes you can do it, but you would need to write a small macro. To help you, we would also need more precise rules. ie What would you want to extract if the cell contained A23BGF44?

    Martin
    Martin Short

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    See if this works for you:

    =LEN(A1)-SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(A1,{0,1,2,3,4,5,6,7,8,9},"")))

    It should accommodate any combination of text and numbers.

    Regards,
    Ron

  4. #4
    Registered User
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Counting the number of letters in a cell

    Thanks a lot...Mr Ron.... You solved my problem.....

+ 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