+ Reply to Thread
Results 1 to 5 of 5

Counting 6 consecutive 0's

  1. #1
    Registered User
    Join Date
    10-25-2011
    Location
    Denver, CO
    MS-Off Ver
    Excel 2007
    Posts
    22

    Counting 6 consecutive 0's

    Hello all,

    I am not sure if this is more a function or a programming question, but I have a sample attached where I am trying to count 6 consecutive 0's in each row to help me identify trends. I am hoping for my end result to give me something akin to a pivot table that would have...

    ID # Times 6 consecutive 0's counted
    1 0
    2 2
    3 4
    4 0


    Any ideas for how to get from the sample to the intended result?

    I tried using frequency functions but I am not quite getting it yet.

    Thank you,
    Ben
    Attached Files Attached Files
    Last edited by bhenderson; 11-14-2011 at 04:31 PM. Reason: [SOLVED]

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Counting 6 consecutive 0's

    Ben

    some questions

    1) How are you intending to determine the range to evaluate, given the are all those trailing zeros.
    2) How do you quantify 6 zero in a row strings? Say you have zeros in B-H, does that make 2 strings of 6 zeros (B-G and E-H) or 1? Using your example file, what should be the result for row 24, and how is that result calculated?

    rylo

  3. #3
    Registered User
    Join Date
    10-25-2011
    Location
    Denver, CO
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Counting 6 consecutive 0's

    Hi Rylo

    1) For most records I need the entire date range. If I could have a stop perameter that said if there are 45+ consecutive 0's flag this row that would be great.

    2) B-H would be one string - good question. And so I would see 26 separate strings of 6 consecutive 0's. But, going back to Q1 there are also 90+ consecutive 0's at the end so I would love to have it notify me that the row may have issues. (i.e. highlight or put some sort of indicator in a new column)

    Does that make sense?

    I attached the sample with how I counted row 24
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Counting 6 consecutive 0's

    Hi

    here goes
    Please Login or Register  to view this content.
    rylo

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Counting 6 consecutive 0's

    Pl see attached file Sheet1(2).
    If you run macro it counts continous zeros in each row and enters the number in the last column of same row.
    Any clarifications welcome.
    Attached Files Attached Files

+ 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