+ Reply to Thread
Results 1 to 6 of 6

Counting duplicate numbers in a string

  1. #1
    Registered User
    Join Date
    04-03-2013
    Location
    ewyork
    MS-Off Ver
    Excel 2003
    Posts
    12

    Counting duplicate numbers in a string

    i want Counting duplicate numbers in a string
    for example Counting 2

    22241278-------- Count(2)=4

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Counting duplicate numbers in a string

    =len(a1)-len(substitute(a1,2,""))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    04-03-2013
    Location
    ewyork
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Counting duplicate numbers in a string

    no no no
    i want Counting duplicate numbers in a string
    for example Counting 2

    222412788-------- Count(1)=1 & Count(2)=4 & Count(4)=1 & Count(7)=1 & Count(8)=2

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Counting duplicate numbers in a string

    yes yes yes
    =len(a1)-len(substitute(a1,2,"")) gives 4 which is 4 lots of 2
    =len(a1)-len(substitute(a1,8,"")) gives 2 which is 2 lots of 8
    see attached for some examples
    Attached Files Attached Files
    Last edited by martindwilson; 04-21-2013 at 08:24 AM.

  5. #5
    Registered User
    Join Date
    04-03-2013
    Location
    ewyork
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Counting duplicate numbers in a string

    this is for 0 , 1 , .... , 9
    I want use for a string
    for example

    aaa22bb32 .............................................. Count(a)=3 & Count(2)=3 & Count(3)=1 & Count(b)=2
    2 * 2 * 2 * 2 * 2 * 2 * 2 * 3 * 3 * 3 * 3............ etc

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Counting duplicate numbers in a string

    add a to z in the top row fill across
    what do you want it to look like exactly
    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    another way is attached
    Attached Files Attached Files
    Last edited by martindwilson; 04-21-2013 at 10:01 AM.

+ 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