Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Apr 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    count char instances within a cell (no vba) (Excel 2002; 10.4109.3401; SP-

    Hi: Is it possible to count the number of characters instances within a single cell using excel functions, i.e., no vba. For example,

    Cell A1 contains: Y, y, N, n,
    Cell A2 contains: 0, 1,

    To count # of commas (",") for Cell A1 would yield a count of: 4
    To count # of commas for Cell A2 would yield a count of: 2

    Thanks in advance for any help!

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: count char instances within a cell (no vba) (Excel 2002; 10.4109.3401;

    1 solution, use:
    =LEN(A1)-LEN(SUBSTITUTE(A1,",",""))

    It calculates the total length of the cell, then deducts the length with the commas removed, resulting in the number of commas.

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: count char instances within a cell (no vba) (Excel 2002; 10.4109.3401;

    See the thread beginning with <post#=163001>post 163001</post#>.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •