Replace the value of a column based on the a matching value of a adjacent columns

Replace the value of a column based on the a matching value of a adjacent columns

基本上,我想根据匹配的国家名称用第二列的数字替换第四列的值。

Country Name    Country Code    Country Name    Country Code
Afghanistan       54             Afghanistan      AFG
Albania           55             Albania          ALB
Algeria           56             Algeria          DZA
American Samoa    57             American Samoa   ASM

答案1

使用 IF 函数:https://support.office.com/en-us/article/IF-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2

I don't have excel at hand at the moment, but it should be something like the following (assuming that the A1 is the header with "Country Name", put the following in the D2): =IF(A2=C2,B2,"AFG")

相关内容