Try this formula in J8 copied down
=IF(OR(COUNTA($B$8:$B$50)=0,ISNUMBER(SEARCH(INDEX($B$8:$B$50,MATCH("zzz",$B$8:$B$50)),K8))),MAX($J$7:J7)+1,0)
HOWEVER, it will only work on the last entry in column B, no going backwards.
Otherwise, you can either set up dummy columns for each entry in B (I used B8:B50 so would require 42 columns. You might need less) or VBA to pull the active cell.
Bookmarks