+ Reply to Thread
Results 1 to 3 of 3

Identify the first set of consecutive values

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Identify the first set of consecutive values

    Hi all,

    I've got a dataset consisting solely of 0's and 1's (representing payments made and missed).

    I need to 1) locate the first set of three or more consecutive zeros in a row, and
    2) return the number of the column immediately before the first zero in that first set of 3+

    So for this example data:

    1 1 1 0 0 0 0 0 0
    1 1 1 1 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 1 1 1 0 0 0 0
    1 1 0 0 0 1 0 0 0

    I would expect the following values to be returned by row:
    3
    4
    0
    5
    2

    Any solution needs to be applicable to a set of any size (more rows/columns) and where the data does not necessarily start at cell A1 (manual updating of the cell references in the formula is ok).

    I know similar questions have been solved here many times, but I can't seem to adapt the formula successfully for this specific purpose.

    Many thanks for your help.

  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: Identify the first set of consecutive values

    =match("000", index(a2:z2 & b2:aa2 & c2:ab2,0),0)-1
    Attached Files Attached Files
    Last edited by martindwilson; 12-13-2013 at 11:15 AM.
    "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
    12-13-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Identify the first set of consecutive values

    Perfect - simpler than I thought! Thank you!

+ 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. Macro to identify column by header and replace number values with string values
    By kang6789 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2013, 05:44 PM
  2. [SOLVED] Consecutive values
    By SgtGil in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-25-2013, 09:35 AM
  3. [SOLVED] Identify workbook with specifc text in consecutive rows and move/rename file
    By me_melb in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-13-2012, 07:00 PM
  4. Summing Values after Finding Max Consecutive Values
    By pipsturbo in forum Excel General
    Replies: 6
    Last Post: 05-12-2009, 08:06 PM
  5. [SOLVED] Return Consecutive Values
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 09-06-2005, 07:05 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