[英]Excel 2007. How can I convert names into unique IDs?
Currently I am forming a dataset in excel.目前我正在excel中形成一个数据集。 With the dataset, I am going to do the panel regression using stata(fixed effect model).
使用数据集,我将使用 stata(固定效应模型)进行面板回归。 However, I cannot change people's names into their unique IDs.
但是,我无法将人们的姓名更改为他们的唯一 ID。 In my dataset, I have name in column B, and I want to generate a new column A with corresponding numbers to names in column B. Doing manually is not an option for me since the number of data is larger than 1,000.
在我的数据集中,我在 B 列中有名称,并且我想生成一个新的 A 列,其编号与 B 列中的名称对应。因为数据数量大于 1,000,所以手动操作不是我的选择。 Two particular problems I encounter are that names are in Korean so the number of characters are mostly the same, and there are same people in different rows.
我遇到的两个特殊问题是名字是韩文,所以字符数基本相同,不同行有相同的人。 Is there any method that I could use?
有什么方法可以使用吗?
If I understand you question correctly, I would do following.如果我正确理解你的问题,我会做以下。
Step 1: Used the Advanced Filter to filter on unique names步骤 1:使用高级过滤器过滤唯一名称
You can place these results on the same sheet or on a different sheet (as per Scott Craner's comment).您可以将这些结果放在同一张纸或不同的纸上(根据 Scott Craner 的评论)。 Both options are listed below
下面列出了两个选项
Filter Names on the same sheet在同一张纸上过滤名称
Filter Names on a different sheet在不同的工作表上过滤名称
This will paste a new range that has all the unique names in your list.这将粘贴一个包含列表中所有唯一名称的新范围。
Step 2: Assign unique IDs to the names in the unique list步骤 2:为唯一列表中的名称分配唯一 ID
Now you have a range (ie unique names and IDs) that you can use VLOOKUP
to populate an ID column in your data set现在您有一个范围(即唯一名称和 ID),您可以使用
VLOOKUP
填充数据集中的 ID 列
Step 3: Use VLOOKUP
to populate IDs for the rows in your dataset步骤 3:使用
VLOOKUP
为数据集中的行填充 ID
=VLOOKUP(B2, $B$1200:$C$1500,2,0)
After you drag this formula down your entire dataset, you'll now have the correesponding unique ID for each name.将这个公式拖下整个数据集后,您现在将拥有每个名称对应的唯一 ID。
Step 4: Cleanup第 4 步:清理
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.