How do I keep a running total of data in a column in Excel?

Imagine a column in Excel that has either "Y" or "N" in it.

I want the column next to it to keep a running count of the number of Y's, but the Y's and N's appear in a random order and I cannot sort by them.

The end result would look like this:

Y:1
N:
N:
Y:2
Y:3
N:
Y:4
N:
Y:5
Y:6
Y:7

etc..

Is this possible?


Solution 1:

Yes, it's possible, enter below formula in your second column and fill it down.

=IF(A2="Y",COUNTIF($A$2:A2,"Y"),"")

enter image description here