+ Reply to Thread
Results 1 to 3 of 3

Counting Partial Number Instances Within a Set Number Length.

  1. #1
    Registered User
    Join Date
    09-20-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Red face Counting Partial Number Instances Within a Set Number Length.

    Hello,

    I'm trying to count all the instances that a partial number sequence occurs within a column of data. The ID numbers have varying lengths of 7-digits and 8-digits and so, I need to separate out the partial string of numbers from both lengths. The COUNTIF function seems to work well with alphanumeric strings but, no so much with numbers only.

    EXAMPLE

    Column A

    1112223
    11223344
    1124435
    11233367
    1134426
    11122234

    And so, how would I tabulate the 7-digit numbers that start with 112... separate from the 8-digit numbers that start with 112... and so on and so forth? I'm trying to factor for a situation where I have a lot of data to sort through and making a mistake in counting by sight is easy. Any and all help is most appreciated.

  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 Partial Number Instances Within a Set Number Length.

    =SUMPRODUCT(--(LEFT($A$1:$A$60,3)="112"),--(LEN($A$1:$A$60)=7))
    =SUMPRODUCT(--(LEFT($A$1:$A$60,3)="112"),--(LEN($A$1:$A$60)=8)) will count them
    to seperate them
    in b1
    =IF(AND(LEFT($A1,3)="112",LEN($A1)=7),$A1,"")
    in c1
    =IF(AND(LEFT($A1,3)="112",LEN($A1)=8),$A1,"")
    "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
    09-20-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Thumbs up Re: Counting Partial Number Instances Within a Set Number Length.

    That works! Thanks so much.

+ 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] Counting number of instances by department.
    By adam_crowther in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2013, 10:31 AM
  2. [SOLVED] Excel 2007 : Counting the number of instances in a specific month
    By Dutch01 in forum Excel General
    Replies: 6
    Last Post: 06-03-2012, 03:25 PM
  3. Counting the number of instances
    By Rhys24 in forum Excel General
    Replies: 9
    Last Post: 06-23-2011, 09:54 AM
  4. Counting Number of Instances with Conditions
    By excalibur69 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-02-2008, 02:44 PM
  5. Counting the number of instances
    By jswarb001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2007, 08:24 AM

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