Auto-Numbering Occurrences Question

B

Bob Stearns

I would like to automatically number the occurrences found in column A in
column B. For example:

A1: One B1: 1 (First occurrence of One)
A2: One B2: 2 (Second occurrence of One)
A3: One B3: 3 (Third occurrence of One)
A4: Two B4: 1 (First occurrence of Two)
A5: Two B5: 2 (Second occurrence of Two)

I am partially there using:
B1 =IF(A1<>"",COUNTA($A$1:A1)&".","")
B2 =IF(A2<>"",COUNTA($A$1:A2)&".","")
B3 =IF(A3<>"",COUNTA($A$1:A3)&".","")
B4 =IF(A4<>"",COUNTA($A$1:A4)&".","")
B5 =IF(A5<>"",COUNTA($A$1:A5)&".","")
but, I need to somehow add the conditional if A changes B restarts numbering
at 1. The file I'm going to copy into column A contains about 3,000
lines/rows.

Thanks for your help...
 
B

Biff

Hi!

Try this:

Enter 1 in B1.

Enter this formula in B2 and copy down as needed:

=IF(A2=A1,B1+1,1)

Biff
 
M

Max

Another play to try, which can be copied straight down from the starting
cell, and even beyond existing data in the col (in readiness for future data
<g>)

With source data in A1 down,
Put in B1: =IF(A1="","",COUNTIF($A$1:A1,A1))
Copy down as far as required
 

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