+ Reply to Thread
Results 1 to 10 of 10

Identify 2 or 3 Conescutives in a string of data

Hybrid View

  1. #1
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Identify 2 or 3 Conescutives in a string of data

    Using the sample file:

    F2:
    =IF(OR($E2<>$E1,$F1=3),"",INDEX({"",2,3,""},MATCH(COUNTIF(INDEX($E:$E,MATCH(2,INDEX(1/($E$1:$E1<>$E2),0))+1):$E2,$E2),{0,2,3,4})))
    copied down
    though I should add that I don't necessarily concur with your expected results... based on my understanding:

    F10 should be 2 rather than F11
    F14 should be 2 rather than F15
    F36 should be 2 rather than Null
    edit: I am sure with more thought the above can be simplified ... it's not efficient.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Identify 2 or 3 Conescutives in a string of data

    edit: in hindsight there's no need for the COUNTIF overhead given the same result can be achieved using just the use ROW difference

    F2:
    =IF(OR($E2<>$E1,$F1=3),"",INDEX({"",2,3,""},MATCH(ROW($F2)-MATCH(2,INDEX(1/($E$1:$E1<>$E2),0)),{0,2,3,4})))
    copied down

+ 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