Using the sample file:
though I should add that I don't necessarily concur with your expected results... based on my understanding:![]()
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
edit: I am sure with more thought the above can be simplified ... it's not efficient.F10 should be 2 rather than F11
F14 should be 2 rather than F15
F36 should be 2 rather than Null
Bookmarks