Is there a formula that will count the number of rows that contain a value (i.e. count the rows that have an "L" in column A) but will stop the total as soon as the value changes in the first instance.

I.e. (column b would be the formula in the below example)

        A       B

1	P	7
2	L	
3	L	
4	L	
5	L	
6	L	
7	L	
8	L	
9	P	5
10	L	
11	L	
12	L	
13	L	
14	L	
15	P	2
16	L	
17	L