Excel的vlookup函数进行数据合并和绝对地址

内容如图所示,


现在想把下面那个表里的卡号按照学号填充到上面那个表的后面,这种情况用到vlookup
在C2里面输入=VLOOKUP(A2,A12:B31,2,FALSE)
最后那个FALSE参数的作用在官方文档上解释如下
Range_lookup   
A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match:

    If TRUE or omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned.

The values in the first column of table_array must be placed in ascending sort order; otherwise, VLOOKUP may not give the correct value. You can put the values in ascending order by choosing the Sort command from the Data menu and selecting Ascending. For more information, see Default sort orders.

    If FALSE, VLOOKUP will only find an exact match. In this case, the values in the first column of table_array do not need to be sorted. If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used. If an exact match is not found, the error value #N/A is returned.

把单元格往下一拖,发现C3的内容变成了=VLOOKUP(A3,A13:B32,2,FALSE)
但是下面这个区域是固定的,所以要用绝对地址,即$A$12:$B$31
这样C3的内容就是=VLOOKUP(A3,$A$12:$B$31,2,FALSE)
效果如图所示



其实这个vlookup函数我原来是用过的
http://hi.baidu.com/kabike/item/d73d49cab269413298b498a9

只是当时没把最后一个参数的意义弄清楚

猜你喜欢

转载自kabike.iteye.com/blog/1729463