+ Reply to Thread
Results 1 to 3 of 3

Count occurrence of character within a cell

  1. #1
    Kelli
    Guest

    Count occurrence of character within a cell

    I would like to count the number of a particular character within a cell. In
    the cell are store numbers/names separated by the | character. The store
    number/name represents a stop that the truck made. There is always one more
    | character than stops. An example is: PER | R7 | PER is one stop at R7.
    Another example is: BAK | 80 | 42 | BAK is 2 stops- one at 80 and one at 42.
    Yes there is a space before and after the | character and PER or BAK is where
    the truck started and ended. Thank you for any help.

  2. #2
    Bernard Liengme
    Guest

    Re: Count occurrence of character within a cell

    Not sure from message what to count.
    This =LEN(A2)-LEN(SUBSTITUTE(A2,"|","")) counts number of | charters in A2's
    value
    So =LEN(A2)-LEN(SUBSTITUTE(A2,"|","")) -1 counts stops?
    best wishes
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "Kelli" <[email protected]> wrote in message
    news:[email protected]...
    >I would like to count the number of a particular character within a cell.
    >In
    > the cell are store numbers/names separated by the | character. The store
    > number/name represents a stop that the truck made. There is always one
    > more
    > | character than stops. An example is: PER | R7 | PER is one stop at R7.
    > Another example is: BAK | 80 | 42 | BAK is 2 stops- one at 80 and one at
    > 42.
    > Yes there is a space before and after the | character and PER or BAK is
    > where
    > the truck started and ended. Thank you for any help.




  3. #3
    Kelli
    Guest

    Re: Count occurrence of character within a cell

    Bernard,
    Thank you. It works and "|" is the correct character.
    Kelli
    "Bernard Liengme" wrote:

    > Not sure from message what to count.
    > This =LEN(A2)-LEN(SUBSTITUTE(A2,"|","")) counts number of | charters in A2's
    > value
    > So =LEN(A2)-LEN(SUBSTITUTE(A2,"|","")) -1 counts stops?
    > best wishes
    > --
    > Bernard V Liengme
    > www.stfx.ca/people/bliengme
    > remove caps from email
    >
    > "Kelli" <[email protected]> wrote in message
    > news:[email protected]...
    > >I would like to count the number of a particular character within a cell.
    > >In
    > > the cell are store numbers/names separated by the | character. The store
    > > number/name represents a stop that the truck made. There is always one
    > > more
    > > | character than stops. An example is: PER | R7 | PER is one stop at R7.
    > > Another example is: BAK | 80 | 42 | BAK is 2 stops- one at 80 and one at
    > > 42.
    > > Yes there is a space before and after the | character and PER or BAK is
    > > where
    > > the truck started and ended. Thank you for any help.

    >
    >
    >


+ 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