This formula will solve both of the problems that you gave in msg# 3
If the data is in A2 to A12 and C2 to C12
Enter this in B2 and fill down:
Formula:
=IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,INDEX(B$1:B1,MATCH(A2,A$1:A1,0)))
Enter this in C2 and fill down (same formula as above with references changed to suit new column)
Formula:
=IF(COUNTIF($C$2:C2,C2)=1,MAX($D$1:D1)+1,INDEX($D$1:D1,MATCH(C2,$C$1:C1,0)))
|
A |
B |
C |
D |
2 |
a |
1 |
b |
1 |
3 |
a |
1 |
a |
2 |
4 |
b |
2 |
b |
1 |
5 |
b |
2 |
b |
1 |
6 |
b |
2 |
b |
1 |
7 |
c |
3 |
a |
2 |
8 |
c |
3 |
a |
2 |
9 |
d |
4 |
d |
3 |
10 |
d |
4 |
c |
4 |
11 |
d |
4 |
c |
4 |
12 |
d |
4 |
d |
3 |
Bookmarks