Add only the cells after a particular number in the previous cell in the same column

D

DrSues02

I have a column with either a Y or a N in every cell of the column.

I have figured out a way to add up all of the Y's in the column.

However, I need to figure out a way to add up the Y's, *but only i
they are in the column following a N, and vice versa.*

Any ideas on how to do this?

In addition, I am trying to figure out winning percentage by usin
these Y's and N's. A Y is a Win and a N is a Loss.

Basically, I need a formula which adds up the total amount of Y's, an
divides it by the total amount of cells (or the Y's + the X's). I ca
do this in three seperate cells if I have Cell1=Y's, Cell 2=Y's+N's
and Cell 3=Cell1/Cell 2, but I havent figured out how to display thi
percentage in a single cell.

Any ideas on this problem?

Or how about if I could display the numbers in win/loss form in
single cell? For example, a function that would count Y's and coun
N's, but then display them in the cell as 11-4 or something to tha
effect. Is this possible?

Any help on these problems would be appreciated
 
J

Jerry W. Lewis

The winning percentage is
=COUNTIF(range,"Y")/(COUNTIF(range,"Y")+COUNTIF(range,"N"))
The intent is to ignore games that have not yet been played, but may be
within the formulas range. Depending on your data, it might be possible
to simplify the denominator to COUNTA(range). Also, what about ties?

Not sure why you want to count only the number of "Y"s that immediately
follow "N"s, but that would be
=SUMPRODUCT((A2:A13="Y")*(A1:A12="N"))
for the range A1:A13. You did not say whether A1 should be counted if
it is "Y" (since by definition nothing precedes it), but this formula
does not count it.

Jerry
 

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

Top