+ Reply to Thread
Results 1 to 5 of 5

count number of text or numbers in a cell?

  1. #1
    Registered User
    Join Date
    02-26-2004
    Location
    philippines
    Posts
    73

    count number of text or numbers in a cell?

    Guys,

    I have a bit of a problem.

    I need to count the number of character in a cell.

    Example: in cell A1 there is 100507, I need a function that will count the characters. IN this case it's 6.

    Is there a function that does this?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Yes

    =len(A1)

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-25-2007
    Posts
    1

    another question

    I have a related question.
    Is there a function I can use to count the number of specific characters within a cell?
    Using the example below, in cell A1 there is 100507, would there be a way to count how many 0's are in the cell? Could the same thing work with a string of text? If I had ABCDDDEFBCDA, would the same function (if it exists) be able to count how many D's are in the cell?
    Also, is there a function that can count how many characters are flanked by the A's?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try this for the first two

    =LEN(A1)-LEN(SUBSTITUTE(A1,"0",""))

    VBA Noob

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    For part two or your question

    =IF(AND(LEFT(A1,1)="A",(RIGHT(A1,1)="A")),LEN(SUBSTITUTE(A1,"A","")),"")

    VBA Noob

+ 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