+ Reply to Thread
Results 1 to 5 of 5

Finding Sequences within a Column

  1. #1
    Registered User
    Join Date
    11-17-2010
    Location
    Nottingham
    MS-Off Ver
    Excel 2007
    Posts
    4

    Finding Sequences within a Column

    Hi,

    Can anyone tell me how I might by able to find a sequence in within a column of numbers.

    For example, if I have the following in cells A1:A10

    1
    0
    0
    0
    1
    1
    1
    1
    0
    0

    I can see that the maximum sequence of 1's is four. What would be the easisest way to formulate this. Unfortunately I have a lot more than 10 cells to check!

    Thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Finding Sequences within a Column

    You got two replies last time you posted this (exact) question.

    http://www.excelforum.com/excel-gene...hin-a-row.html

    The only difference seems to be the sample numbers.

    Did neither of those solutions work for you?

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Finding Sequences within a Column

    A basic way might be

    C2
    Please Login or Register  to view this content.
    Drag/Fill Down

    B2
    Please Login or Register  to view this content.
    Drag/Fill Down

    This should give the sequence of any groups of numbers=

    To find the longest run of a number, in this example it will be zeros
    Please Login or Register  to view this content.
    Confirmed with Ctrl+Shift+Enter
    Alter the range limits to suit.

    Hope this helps

    [EDIT]
    Thanks for the warning TMShucks unfortunately to late!
    WTH this is a different approach, perhaps not as elegant as some might offer.
    Attached Files Attached Files
    Last edited by Marcol; 11-25-2010 at 09:09 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    11-17-2010
    Location
    Nottingham
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Finding Sequences within a Column

    Quote Originally Posted by TMShucks View Post
    You got two replies last time you posted this (exact) question.

    http://www.excelforum.com/excel-gene...hin-a-row.html

    The only difference seems to be the sample numbers.

    Did neither of those solutions work for you?

    Regards
    Appologies - I didn't setup the e-mail notification and couldn't find my original thread to see if anybody had replied.

    Thanks very much for your help and sorry for the duplication.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: Finding Sequences within a Column

    No problem.

    The easy way to find your post(s) is to left click on your name and then select Find All Posts By ...

    Regards

+ 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