count characters up to a certain point

Peter1973

Well-known Member
Joined
May 13, 2006
Messages
957
I am trying to get a formula to look in A1:A1000 from A1 downwards and coutn how many "x" there are until it gets to a "y".

hope this is clear any help appreciated.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Just one set of x's then a y?
Or multiple sets of x's?
e.g.


x
x
x
y

x
x
x
x
x
y
 
Upvote 0
Multiple like the list you have put.
Something like this then, copied down?


Book1
AB
1DataCount
2x 
3x
4x
5y3
6
7x
8x
9x
10x
11y4
12y0
13x
14y1
15x
Count x
Cell Formulas
RangeFormula
B2=IF(A2="y",COUNTIF(A$2:A2,"x")-SUM(B$1:B1),"")
 
Upvote 0

Forum statistics

Threads
1,215,500
Messages
6,125,168
Members
449,211
Latest member
ykrcory

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top