Related Topics: | ||
Description: Looks for a value in the leftmost column of a table and returns a value from the column number you specify.
The V in VLOOKUP stands for vertical. Use VLOOKUP instead of HLOOKUP when your comparison values are located in a column to the left of the data that you want to find.
Syntax: VLOOKUP(Lookup_value, Table_array, Col_index_num, [Range_lookup])
Lookup_value is the value to search in the first column of the table array. Lookup_value can be a value or a reference. If Lookup_value is smaller than the smallest value in the first column of Table_array, VLOOKUP returns the #N/A error value.
Table_array is two or more columns of data. Use a reference to a range or a range name. The values in the first column of Table_array are the values searched by Lookup_value. These values can be text, numbers or logical values. Uppercase and lowercase text are equivalent.
Col_index_num is the column number in Table_array from which the matching value must be returned. A Col_index_num of 1 returns the value in the first column in Table_array; a Col_index_num of 2 returns the value in the second column in Table_array, and so on. Range_lookup is 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 Sheet Options > Sheet Actions > Sort > Sort Ascending.
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.
Range_lookup is a logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than Lookup_value is returned. If FALSE, VLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.
Remarks:
Col_index_num must be greater than or equal to 1 and less than or equal to the number of columns in Table_array.
When searching text values in the first column of Table_array, ensure that the data in the first column of Table_array does not have leading spaces, trailing spaces, inconsistent use of straight and curly quotation marks, or nonprinting characters. In these cases, VLOOKUP may give an incorrect or unexpected value.
When searching number or date values, ensure that the data in the first column of Table_array is not stored as text values. In this case, VLOOKUP may give an incorrect or unexpected value.
If Range_lookup is FALSE and Lookup_value is text, then you can use the wildcard characters, question mark (?) and asterisk (*), in Lookup_value. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the character.
Example:
On the preceding worksheet, where the range A4:C12 is named Range:
VLOOKUP(1, Range, 1, TRUE) = 0.946
VLOOKUP(1, Range, 2) = 2.17
VLOOKUP(1, Range, 3, TRUE) = 100
VLOOKUP(.746, Range, 3, FALSE) = 200
VLOOKUP(0.1, Range, 2, TRUE) = #N/A, because 0.1 is less than the smallest value in column A
VLOOKUP(2, Range, 2, TRUE) = 1.71
© 1992-2013. ReliaSoft Corporation. ALL RIGHTS RESERVED.