I am trying to count the number of times an A appears in a column 5 or more times in a row, the question I have is there are cells which have an "X" in them and I want it to ignore the X value when considering if an A appears consecutively. This is an attendance sheet so the "X" values are for non work days i.e. Sat/Sun. So if someone is out on Friday and then out Mon-Thursday it should count the "A"'s as 5 consecutive values.

16 17 18 19 20 21 22 23 24 25 26

P P P P A X X A A A A

result for count of cnsecutive "A" should be 5.

Here is the formula I have, but it does not exclude the X's

{=SUM(IF(FREQUENCY(IF($F6:$LE6="A",COLUMN($F6:$LE6)),IF($F6:$LE6<>"A",COLUMN($F6:$LE6)))>=5,FREQUENCY(IF($F6:$LE6="A",COLUMN($F6:$LE6)),IF($F6:$LE6<>"A",COLUMN($F6:$LE6))),0))}

## Bookmarks