counting a reoccuring pattern within column

G

generician

you got me on the right track and i figured something out, but i'm not
sure how elegant it is. not sure if you care, but here's what i did.
i wrote an array formula. the pattern i was looking for was the
nonconsecutive five-number pattern "4,1,3,2,4". I wanted to see how
many times it appeared in a column. so, i copied and pasted that
column five times across columns L through P deleting the top cell from
each consecutive column in addition to those deleted from the former.
so, column L had 45 cells, M had 44, N had 43, etc. then i wrote this
array formula
"=SUM(IF(L1:L40=4,IF(M1:M40=1,IF(N1:N40=3,IF(O1:O40=2,IF(P1:p40=4,1,0))))))".
I used this method to arrive at a macro that tells me how many times a
pattern appears in a column.
 
F

Frank Kabel

Hi
try with only one column
=SUMPRODUCT(--(L1:L36=4),--(L2:L37=1),--(L3:L38=3),--(L4:L39=2),--(L5:L
40=4))
 
Top