Convert list of names to list of numbers

Copper Contributor
I have a list of names that are repeated for example:
Cat; cat; dog; horse; dog; etc. in a column and I have a legend , a table, where for example there is dog, 1; cat,2; horse,3; how can I get a column 2;2;1;3;1? Where every names is convert in associated number?
2 Replies

@michelemascioli see the attached file pls

Hope this solves it!! otherwise please tell me exactly what your mean..
have a nice day

@Ramiz_Assaf your attached solves it, thank you very much!!