Jock,
After having failed with Index/match and a UDF, a completely different
approach using a helper column.
Col a Col B Col C Col D
a a1 12 a
b b1 13
c c1 14
a a2 15
e e1 16
a a3 17
e e2 18
b b2 19
a a4 20
b b3 21
Column B1 has a formula
=A1&COUNTIF($A$1:A1,A1)
Put this in and drag down.
You can hide this helper column.
In another cell enter
=MATCH(VLOOKUP($D$1&ROW(),$B$1:$C$10,2,FALSE),$C$1:$C$10,0)
This matches the contents of D1 with Column B, returns column C and the row
of that.
Drag down for the second and subsequent instances of whaever is in D1.
What the *** does Traa Dy Liooar mean?
Mike