+ Reply to Thread
Results 1 to 8 of 8

Detecting where the sequence changes

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Detecting where the sequence changes

    Hi everyone,

    Hopefully a simple problem!

    I'm looking to find the first time a number changes in a sequence - this change could be +ve or -ve (hence my issue)

    r7oumjbhQna3aUxg0YI_pw.png

    As the screenie suggests, the answer I'm looking for is 215

    Any questions pop em below

    Ty

    Mdn
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Detecting where the sequence changes

    Is a helper row 4 permitted or is this a very simple example and there's data in many rows.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Detecting where the sequence changes

    ...how about n array formula

    Formula: copy to clipboard
    =INDEX(B2:KO2,1,MATCH(TRUE,A3:KO3<>B3:KP3,FALSE))


    Damn, Falcondude beat me to it!

  4. #4
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Re: Detecting where the sequence changes

    Quote Originally Posted by Richard Buttrey View Post
    Is a helper row 4 permitted or is this a very simple example and there's data in many rows.
    Only a simple example

    392u8Sd2Tz6E3PFdPdBdsw.png

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Detecting where the sequence changes

    Try this:

    =INDEX(B2:KO2,MATCH(TRUE,A3:KN3<>B3:KO3,0)) Ctrl Shift Enter

    or the non-CSE alternative:

    =INDEX(B2:KO2,INDEX(MATCH(TRUE,A3:KN3<>B3:KO3,0),0))
    Last edited by 63falcondude; 12-13-2018 at 02:22 PM. Reason: Added second formula

  6. #6
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    312

    Thumbs up Re: Detecting where the sequence changes

    Quote Originally Posted by 63falcondude View Post
    Try this:

    =INDEX(B2:KO2,MATCH(TRUE,A3:KN3<>B3:KO3,0)) Ctrl Shift Enter

    or the non-CSE alternative:

    =INDEX(B2:KO2,INDEX(MATCH(TRUE,A3:KN3<>B3:KO3,0),0))
    Quote Originally Posted by Richard Buttrey View Post
    ...how about n array formula

    Formula: copy to clipboard
    =INDEX(B2:KO2,1,MATCH(TRUE,A3:KO3<>B3:KP3,FALSE))


    Damn, Falcondude beat me to it!
    Quote Originally Posted by Pete_UK View Post
    You have a sequence of 85 threes starting with cell A3, and no other cells after that which contain 3, so in that case you can use this formula in cell KQ3:

    =INDEX(2:2,COUNTIF(A3:KO3,A3)+1)

    If you do have any other cells with 3 in them after the first sequence, then this formula will produce erroneous results.

    Hope this helps.

    Pete
    Top stuff all many many thanks

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Detecting where the sequence changes

    You have a sequence of 85 threes starting with cell A3, and no other cells after that which contain 3, so in that case you can use this formula in cell KQ3:

    =INDEX(2:2,COUNTIF(A3:KO3,A3)+1)

    If you do have any other cells with 3 in them after the first sequence, then this formula will produce erroneous results.

    Hope this helps.

    Pete

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Detecting where the sequence changes

    Glad we could help.

    Thanks for the rep!

+ 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. Find a short-sequence in a longer sequence (Clash Royale Chests Challenge)
    By GeneralDisarray in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-08-2016, 12:20 PM
  2. Replies: 7
    Last Post: 06-08-2015, 08:39 AM
  3. [SOLVED] Creating a sequence based on numbers in one column and adding "01,02..." to a new sequence
    By JCR1968 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2013, 08:06 AM
  4. Replies: 0
    Last Post: 12-12-2012, 06:39 PM
  5. [SOLVED] Detecting a value in a range
    By michaelt721 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-26-2012, 03:40 AM
  6. Detecting same value in 3 cells
    By Excript in forum Excel General
    Replies: 11
    Last Post: 03-12-2009, 06:14 AM
  7. Detecting Top of Page
    By ffffloyd in forum Excel General
    Replies: 2
    Last Post: 02-08-2009, 08:50 PM

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