了解Excel中的vlookup公式? [英] Understanding the vlookup formula in Excel?
问题描述
我有电子表格中的两个列表和一些名称匹配,一些不匹配。
I have two lists in the spreadsheet and some of the names match and some do not.
我需要一个公式,以便在文本匹配的地方可以分配相应的值。
I need a formula so that where the text matches it can assign the corresponding value.
例如:在B2中,它将读取0或false,因为在C列中没有Jimmy T.但是,在B3中,公式应该像在A3中的文本匹配C列中的任何文本一样工作,它会分配直接在右侧的相应的D值。那么B3中的答案是47.33。
For example: in B2 it would read a 0 or false because there is no Jimmy T. in the C column. However, in B3 the formula should work as if the text in A3 matches any text in the C column it assigns the corresponding D value that is directly to the right. So, in B3 the answer would be 47.33.
最终目标是使B列中的值与列A相对应,与列C对应于列D的方式相同。
和在列A中没有值为B的False。
The ultimate goals is for the value in the B column to correspond with Column A the same way that column C corresponds with column D.
And where there is not a value for column A to have it read "False" in column B.
推荐答案
在B2上键入: / p>
Type on B2:
=VLOOKUP(A2,$C$2:$D$7,2,FALSE)
然后,将公式拖动到列B上的其他单元格。vlookup公式有四个参数(见下面的解释)。
then, drag the formula down to the other cells on column B. The vlookup formula has four arguments (see explanation below).
要发现没有匹配的单词False升级到以下公式:
To have the word "False" appearing where no match is found upgrade to the following formula:
=IFERROR(VLOOKUP(A2,$C$2:$D$7,2,FALSE),"False")
这是一个关于上述公式输出的例子。
This is a example about the above formula's output.
基本上,vlookup函数的作用是:
Basically, what the vlookup function does is:
- 找到一个给定一个数组(第二个参数),为指定的单元格匹配(第一个公式参数),
- 。数组中最左边的列必须具有与公式的第一个参数匹配的值),
- ,如果有匹配则返回该数组的一个特定列的值(第三个公式参数)。在上面的例子中,我们要返回指定数组的第二列。
- vlookup公式的最后一个参数返回一个近似匹配(TRUE)或完全匹配( FALSE)。
- to find a match for the specified cell (first formula argument),
- given an array of values (second argument). The leftmost column in the array must have the values to be matched with the formula's first argument),
- and if there is a match it returns the values from one specific column of this array (third formula argument). In the above example we want to return the second column of the specified array.
- The last argument on the vlookup formula returns the value for an approximate match (TRUE) or for an exact match (FALSE).
这篇关于了解Excel中的vlookup公式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!