ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell Counter/Increment (https://www.excelbanter.com/excel-programming/448981-cell-counter-increment.html)

User[_4_]

Cell Counter/Increment
 
I'm trying to write a formula to produce results such as:

AA 1
BB 0
BB 0
AA 2
AA 3
BB 0
AA 4
CC 0

Column A is a (drop-down) data validated list of 'AA,BB,CC'.
Column B is the counter cell.

Every 'AA' increments a counter, anything not 'AA' yields a 0.

I've tried using the countif but it seems to give me a sum rather than what I'm looking for, at least to what I understand its use of from the help.

Is this possible in a formula? I'd rather not have to use VBA code if at all possible.

isabelle

Cell Counter/Increment
 
hi,

=IF(A1="AA",COUNTIF($A$1:A1,"AA"),0)

and fill down

isabelle


Le 2013-07-09 21:03, User a écrit :
I'm trying to write a formula to produce results such as:

AA 1
BB 0
BB 0
AA 2
AA 3
BB 0
AA 4
CC 0

Column A is a (drop-down) data validated list of 'AA,BB,CC'.
Column B is the counter cell.

Every 'AA' increments a counter, anything not 'AA' yields a 0.

I've tried using the countif but it seems to give me a sum rather than what I'm looking for, at least to what I understand its use of from the help.

Is this possible in a formula? I'd rather not have to use VBA code if at all possible.


Portunus

Cell Counter/Increment
 
On Tue, 09 Jul 2013 21:37:20 -0400, isabelle wrote:

Thanks so much. This worked perfect. I was missing the anchor $A$1,
never thought of that!

hi,

=IF(A1="AA",COUNTIF($A$1:A1,"AA"),0)

and fill down

isabelle


Le 2013-07-09 21:03, User a écrit :
I'm trying to write a formula to produce results such as:

AA 1
BB 0
BB 0
AA 2
AA 3
BB 0
AA 4
CC 0

Column A is a (drop-down) data validated list of 'AA,BB,CC'.
Column B is the counter cell.

Every 'AA' increments a counter, anything not 'AA' yields a 0.

I've tried using the countif but it seems to give me a sum rather than what I'm looking for, at least to what I understand its use of from the help.

Is this possible in a formula? I'd rather not have to use VBA code if at all possible.



All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com