简体   繁体   English

如果在另一列上找到一个单元格的值,如何从与同步单元格在同一行的另一列返回该单元格的值?

[英]If a cell's value is found on another column, how to return the cell's value from another column which is on same row with the synced cell?

My Excel table is looking like this. 我的Excel表看起来像这样。

A column is the one that I want to fill in with correct data. 
B column is where the lookup values are.
C column is the one where I want to extract data from. 
D column is where data from B column will be searched.

For example, if data from B2 is found on D7 cell, I want to have in A2 the value from C7. 例如,如果在D7单元中找到了来自B2的数据,我希望在A2中具有来自C7的值。

My Countries///My Codes////All Countries//////All Codes 我的国家///我的代码////所有国家///////所有代码

                AD        Afghanistan      AF
                AU         Albania         AL
                           Algeria         DZ
                        American Samoa     AS
                           Andorra         AD
                           Angola          AO
                          Anguilla         AI
                         Antarctica        AQ
                    Antigua and Barbuda    AG
                          Argentina        AR
                          Armenia          AM
                           Aruba           AW
                         Australia         AU
                          Austria          AT
                         Azerbaijan        AZ

It would be much appreciated your help because I would like to learn as much as I can about excel formulas. 非常感谢您的帮助,因为我想尽可能多地了解excel公式。

Kind Regards, Ioan 亲切的问候,伊安

In A1 enter: A1中输入:

=INDEX(C$1:C$15,MATCH(B1,D$1:D$15,0))

and copy down: 并抄下来:

在此处输入图片说明

Note: 注意:

MATCH() finds the row. MATCH()查找行。
INDEX() grabs the value. INDEX()获取值。

Chris is right, looks like you need a vlookup, example 克里斯说得对,看起来您需要一个vlookup,例如

B1 would be B1将是

=Vlookup(A1,c1:d200,2,0) = VLOOKUP(A1,C1:d200,2,0)

B2 would be B2将是

=Vlookup(A2,c1:d200,2,0) = VLOOKUP(A2,C1:d200,2,0)

And so on 等等

It works like this Vlookup (value to lookup, range the lookup and return values are in, column number from range you want to return, exact match only (0 or false)) 它的工作方式类似于此Vlookup(要查找的值,查找和返回值所在的范围,您要返回的范围中的列号,仅完全匹配(0或false))

Though Chris's link is more detailed 尽管克里斯的链接更详细

暂无
暂无

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

相关问题 如何获取VBA代码以检查单元格值是否与列标题匹配并从同一行中的另一个单元格返回值? - How to get VBA code to check if cell value matches column heading and return value from another cell in the same row? 从与另一行中的单元格相对应的行中获取值(在同一列中) - Get value from a row that corresponds (in the same column) to a cell in another row 搜索列中的每个单元格以查找特定值,并从该值所在的行中的另一个单元格复制值 - Search each cell in a column to find a certain value and copy value from another cell in the row the value is found in 搜索Excel列,并从同一行但位于不同列中的另一个单元格中输出值 - Search Excel column and give out the value from another cell which is in the same row but in a different column Excel:如何在包含字符串的列中查找单元格并在另一列行中返回单元格的值? - Excel: How to find cell in a column that contains a string and return value of a cell in another column of row? 如何在另一个工作表上查找单元格值,并将值放在找到第一个值的行的另一列上 - How to find a cell value on another worksheet and place a value on another column for the row where the first value was found 如何在包含字符串的列中查找单元格并在另一行中返回单元格的值? - How to find cell in a column that contains a string and return value of a cell in another of row? 如何基于同一行中的另一个单元格突出显示列中单元格值的所有实例? - How to highlight all instances of a cell value in a column based on another cell in same row? 如果另一列中存在单元格值,请保留行 - Keep row if cell value exist in another column 如果第 7 列中的一个单元格等于另一个单元格中的值,则更改为另一个单元格中的值 - If a cell in Column 7 equals the value in another cell change to the value in another cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM