Assigning values as codes

R

rayjuan

I would like to ask for help please. How do you assign values and make
them as codes in excel? For example, I made a list of validation in
excel (a drop-down list). Say that the list includes the gender of a
person = male, female. How do I assign a number to the gender like 1 if
male and 2 if female? Any help would be appreciated. Thanks
 
B

Bernard Liengme

If you are happy to use another column: =IF(A2="male",1,2) This aaumes that
the validation ensures the enty is either male or female
But why do this? If you have entered textual values why convert to numbers.
You can summ the occurences of "male" just as readily as those of "1".

If the male/female thing was just a simple example and the real case has
more than 2 values them consider using a VLOOKUP (or HLOOKUP) formula.

We need more info to give a full aswer

Best wishes
Bernard
 
Top