It might be better to label them with numbers, otherwise you will run out of letters after "Z". Put this in C1:

=IF(B1="x",SUMPRODUCT((A$1:A1=A1)*(B$1:B1="x")),"")

then copy down.

Hope this helps.

Pete

EDIT: If you really want letters, then you can use this in C1:

=IF(B1="x",CHAR(SUMPRODUCT((A$1:A1=A1)*(B$1:B1="x"))+64),"")

then copy down.

Pete