Hi guys,

what i want is to come up with some type of a formula that counts all that times a specific sequence of letters (shifts in this case) appears. For instance all the times the sequence is N→X→A . Where M is morning shift, N is night and A is afternoon. See below.

M M M M Χ Χ Χ Χ Ν Ν Ν Ν Ν
Χ Ν Ν Ν Ν Ν Ν Ν Χ Α Α Α Χ
Ν Χ Α Α Χ Α Α Α Α Χ Χ M M
Α Α Χ Χ M M M M M M M Χ Χ
Ν Χ Α Α Α Χ Α Α Α Χ Χ M M

Thanks a lot in advance