Count "how many in a row"

T

TeddyTash

Is there anything I can do to get a cell to show how many times the sam
data is entered.

Example
1 A
2 B
3 B
4 B
5 A
6 B
7 A
8 A

Can I get something that will return the following:
A = 3
B = 2

Because B has come up 3 times in sucession (2-4) while A has only com
up twice in sucession (7-8)
 
D

Domenic

Assuming that Column A contains your data, try the following...

B1: enter the number 1

B2, copied down:

=IF(A2=A1,B1+1,1)

D1: enter A

D2: enter B

E1, copied down:

=MAX(IF($A$1:$A$8=D1,$B$1:$B$8))

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!
 
Top