+ Reply to Thread
Results 1 to 5 of 5

How to count partial matches in single cell with multiple concatenated values?

  1. #1
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    How to count partial matches in single cell with multiple concatenated values?

    Good night,

    Could anyone help me to find out how to look for the number of times a specific text or character appears as a substring inside a cell?

    I have a column populated with multiple concatenated SKU in each cell/row. Sometimes it could have 1 single code, or dozens, but they have the same lenght and carry a ";" separator. I need to count the number of items in each cell, therefore I thought I could count how many ";" there are. In another situation I need to count different parts of the code, as it's built combining different other codes, but follows a 4 char lenght pattern (3 numbers + 1 letter).

    I tried using the following formula to count with wildcards, but it seems to count only 1 occurence, no matter what:

    Please Login or Register  to view this content.
    Example of a single string:

    Please Login or Register  to view this content.
    I tried using a reference cell instead of writing it, but it gives me the same result. One other thought I had was about counting the lenght of the string and dividing it by the lenght of each code, as they are always the same lenght, but I was actually trying to avoid that and hoping I could get around with something like above.

    Any help is appreciated. Thanks in advance.
    Last edited by therealdees; 05-03-2021 at 01:25 PM.
    Pedro.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: How to count partial matches in single cell with multiple concatenated values?

    To count ; try this...
    =LEN(A26)-LEN(SUBSTITUTE(A26,";",""))

    To count specific string eg 00 try this...
    =(LEN(A26)-LEN(SUBSTITUTE(A26,"00","")))/2

    the /2 is because I am searching for just 2 characters - adjust that as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Re: How to count partial matches in single cell with multiple concatenated values?

    Hello FDibbins,

    Sorry for the delay, been in a rush, and thanks for the reply!

    The second formula you provided is exactly what I need and I did manage to adapt it for my use. Thank you a lot for your help

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,597

    Re: How to count partial matches in single cell with multiple concatenated values?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: How to count partial matches in single cell with multiple concatenated values?

    Happy to help and thanks for the feedback

+ 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. Count values based on multiple cell matches
    By cmav in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-28-2020, 02:36 PM
  2. Lookup and return multiple values concatenated in one cell
    By jstanley41 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-14-2018, 03:12 PM
  3. Multiple values concatenated into one cell
    By brendanlowrywork in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-22-2017, 09:28 AM
  4. [SOLVED] Get a count of multiple values from a range within a single cell?
    By ziggyztz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-04-2017, 04:21 PM
  5. [SOLVED] Count partial text matches in adjacent column
    By joshkvt in forum Excel General
    Replies: 6
    Last Post: 08-11-2014, 12:01 PM
  6. How to count multiple values in a single cell, except zero?
    By iuliandonici in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-14-2011, 07:39 AM
  7. Replies: 2
    Last Post: 10-30-2007, 12:12 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