简体   繁体   English

在这种情况下如何使用vlookup命令

[英]how to use vlookup command in this situation

the sytax of vlookup vlookup的语法

vlookup(value we are looking for, Data range, index, exact/aprrox. match)

ie vlookup(A1,B1:E3,1,false) the vlookup will the first column for looking up our desired value which is in cell A1. vlookup(A1,B1:E3,1,false)vlookup(A1,B1:E3,1,false)将在单元格A1中查找所需值的第一列。 but if with the same data range i want it to search my value "A1" in the 3rd column and it should return me the value in the first column. 但是,如果数据范围相同,我希望它在第三列中搜索值“ A1”,并且应该在第一列中返回该值。

Example to clearify my question 例子来澄清我的问题

     A      B      c     D    E
1    22    area    3     4    5
2          length  2     22   2
3          height  4     32   7

in the above data I want excel to search A1 which is "22" in column D and return the value opposite to it in column B which is "length" 在上面的数据中,我希望excel在D列中搜索A1(即“ 22”),并在B列中返回与之相反的值(即“ length”)

Try this 尝试这个

=INDEX(B1:B3,MATCH(A1,D1:D3,0))

In responce to comment, using Index Match in a horizontal fasion: 为了回应评论,在水平方向使用Index Match

Suppose your data is like this 假设您的数据是这样的

     A      B       C       D
1    22     area    length  height
2           3       2       4
3           4       22      32
4           5       2       7

To get the same result as per your original data, use 要获得与原始数据相同的结果,请使用

=INDEX(B1:D1,MATCH(A1,B3:D3,0))

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

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