Full Version: sequence count formula
UtterAccess Discussion Forums > Microsoft® Office > Microsoft Excel
gooanna
I'm trying to find out a formula that counts all the sequence.

For example,

A
A
A
B
B
C
C
C
C

It's going to be a long table(w/ info.) so, I was wondering if there would be a formula that will count the sequence of each occurance.

The result would be:

A 1
A 2
A 3
B 1
B 2
C 1
C 2
C 3
C 4


Please help!!!1
Thanks!!
Luceze
Are they sorted? If so (assuming data starts in A1)...

Enter 1 in cell b1.

Enter this formula in b2:
=IF(A2=A1,B1+1,1)

HTH,
KingMartin
And for the case they're not sorted:

=COUNTIF($A$1:$A1,$A1)

enter in B1, copy down along the data in A.

Martin
gooanna
THANKS a BUNCH GUYS!!!!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.