[Excel] - How to assign numerical values to text data on Excel

Can someone help me in sorting and assigning unique id in excel. The data is shown below

contact name locality city State Country email
Brian xyz Street London ABC UK ab@0.com
Mary ABC Street Rome QXE ITALY qw@0.com

Field id's

1- contact name
3- Locality
4- City
12- State
14- Country
17- Email

I want the data sorted like below
1- Brian
2-XYX street
4- London
12- ABC
17- ab@0.com
2-ABC street

Can someone help me to sort data as shown above. It will be a very big help for me.
Many thanks in advance.
Think you need a specific macro for doing that. You should also use a drop-down option. Please PM me the full list of options to take a look.
Hi, I also have a similar problem. I want to assign numerical values to text data (Gender, Marital Status, and Level of Education) in MS Excel and do a Chi Squared test. Unfortunately I can't use SPSS so I am stuck with MS Excel.