counting a reoccuring pattern within column

  • Thread starter Thread starter generician
  • Start date Start date
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.
 
Hi
try with only one column
=SUMPRODUCT(--(L1:L36=4),--(L2:L37=1),--(L3:L38=3),--(L4:L39=2),--(L5:L
40=4))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top