简体   繁体   English

根据 Excel 中的另一个值更新一列中的值

[英]Update value in one column based on another value in Excel

I have an excel with 10,000 rows and 2 columns (ID, Name)我有一个 10,000 行和 2 列(ID、名称)的 excel

Each ID has a corresponding name每个ID都有一个对应的名字

ID |身份证 | NAME姓名
1 | 1 | John Smith约翰·史密斯
2 | 2 | Rob More抢更多
1 | 1 | John Smith约翰·史密斯
2 | 2 | Rob More抢更多
3 | 3 | Ben Jackson本杰克逊
3 | 3 | Ben Jackson本杰克逊

I would like to update the "NAME" column based on the value in the "ID" column.我想根据“ID”列中的值更新“NAME”列。

If ID is 1, I would like to change the value of NAME column from John Smith to Ryan Smith.如果 ID 为 1,我想将 NAME 列的值从 John Smith 更改为 Ryan Smith。 All the rows containing ID as 1 should be changed to Ryan Smith. ID 为 1 的所有行都应更改为 Ryan Smith。

I wish to replace real values in the NAME column to some dummy values.我希望将 NAME 列中的实际值替换为一些虚拟值。

As you can see from the screenshot below, I created a list of all the ID-NAME pairs.正如您从下面的屏幕截图中看到的那样,我创建了所有 ID-NAME 对的列表。 In the right box you can see, how the VLOOKUP function is used.在右侧框中,您可以看到如何使用VLOOKUP函数。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM