colA
is what I currently have.
However, I'm trying to generate colB
.
I want colB
to contain the number 001
for each value. However if the associated colA
value exists twice in that column, I want the colB
number to then be 002
, and so on.
Hopefully the example below gives a better idea of what I'm looking for based on the colA
values. I've been struggling to put together any real code for this.
EDIT: Struggling to explain this in words, so if you can think of a better way to explain it feel free to update my question.
colA colB
BJ02 001
BJ02 002
CJ02 001
CJ03 001
CJ02 002
DJ01 001
DJ02 001
DJ07 001
DJ07 002
DJ07 003