+ Reply to Thread
Results 1 to 4 of 4

Count all the unique values in a cell separated by a pipe delimiter, i.e. |

  1. #1
    Registered User
    Join Date
    05-02-2013
    Location
    Madrid, Spain
    MS-Off Ver
    Excel 2011, Mac
    Posts
    19

    Count all the unique values in a cell separated by a pipe delimiter, i.e. |

    Good morning everybody.

    I have a range of cells containing names of scientists separated by a pipe delimiter.

    For example
    Propp; Michael B.|Propp; David L.
    De Gaudenzi; Riccardo|Viola; Roberto|Elia; Carlo
    Benedicto Ruiz; Francois-Xavier|Lopriore; Mario|Bella; Luigi

    I needed to count the number of scientists in each cell, assuming they are separated by a pipe delimiter. So, the formula would need to return the value 2 for the first of my examples, and 3 for the second and the third.

    It needs to therefore count the number of delimiters and return the value of that count + 1 - i.e. if there are two delimiters in the string, then there must be three items, and so on.

    Have any ideas?

    Thank you so much!

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Count all the unique values in a cell separated by a pipe delimiter, i.e. |

    hi Lija. assuming data in A2, try:
    =LEN(A2)-LEN(SUBSTITUTE(A2,"|",""))+1

    substitute commas with semi-colons if your region settings requires

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Count all the unique values in a cell separated by a pipe delimiter, i.e. |

    =len(a1)-len(substitute(a1, "|",""))+1
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    05-02-2013
    Location
    Madrid, Spain
    MS-Off Ver
    Excel 2011, Mac
    Posts
    19

    Re: Count all the unique values in a cell separated by a pipe delimiter, i.e. |

    works like a charm
    thanks one again, I always appreciate the fast responses.

+ 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