+ Reply to Thread
Results 1 to 4 of 4

Count Delimited Text within a Cell

  1. #1
    Registered User
    Join Date
    06-30-2014
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    4

    Count Delimited Text within a Cell

    Hi...this is my first post, and I'm a Formula novice with no VBA experience.

    I have multiple items (Country Names) in cells exported from another database with what appear to be delimiters (semicolons) that cannot be counted. I want to count the number of items (Countries) separated by the delimiters. Is there a simple way to do this?

    Column 1 fields:
    TAIWAN, PROVINCE OF CHINA;
    BELGIUM;HUNGARY;SWEDEN;ITALY;POLAND;SLOVAKIA;
    CANADA;
    BELGIUM;HUNGARY;SWEDEN;ITALY;POLAND;SLOVAKIA;CANADA;
    INDIA;BRAZIL;DENMARK;GREECE;POLAND;MOLDOVA, REPUBLIC OF;HUNGARY;UNITED STATES;UNITED KINGDOM;

    Result needed in Column 2:
    2
    6
    1
    7
    9

    What is the formula needed to get the Column 2 result?

    Thanks for any help!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Count Delimited Text within a Cell

    Hi, and welcome to the forum.

    I'm assuming that first record is a typo since the delimiter after Taiwan is a comma not a semi colon.

    One way in B1 copied down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-30-2014
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    4

    Smile Re: Count Delimited Text within a Cell

    Thanks, Richard! It works perfectly, and so much time saved! (Now to try to break it down and understand it myself!)

    Yes, the first item was indeed a typo..."Taiwan, Province of China" is a single item, not two.

    Thanks for the QUICK save. I looked at the LEN function as an option, but would never have come up with the proper string/syntax in a reasonable time frame...much appreciated!

    J

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Count Delimited Text within a Cell

    Quote Originally Posted by JE2BD View Post
    Thanks, Richard! It works perfectly, and so much time saved! (Now to try to break it down and understand it myself!)



    J
    Glad to have been able to help

    The SUBSTITUTE() function (not a very well known function) is very useful for stuff like this. By replacing any character in a string with the "" null character you effectively reduce the length of the original string by the number of characters you specify. It's then a simple matter to deduct the length of this reduced string from the length of the original to tell you the number of characters you've replaced.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Count instances of text in a comma-delimited column
    By david.aukerman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-01-2013, 10:30 AM
  2. Replies: 21
    Last Post: 08-13-2012, 01:52 PM
  3. Sorting delimited text within cell
    By greek in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-01-2012, 06:19 PM
  4. Shuffle delimited text in a cell
    By greek in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-26-2011, 08:01 PM
  5. Importing Delimited Text/Exporting Delimited Text Loop
    By cecarter74 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-05-2009, 01:17 PM

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