VLOOKUP Function
VLOOKUP Function
VLOOKUP
Important notice for users of Office 2003 To continue receiving security updates for Office, make Show All
sure you're running Office 2003 Service Pack 3 (SP3). The support for Office 2003 ends April 8,
2014. If you’re running Office 2003 after support ends, to receive all important security updates for Office, you
need to upgrade to a later version such as Office 365 or Office 2013. For more information, see Support is ending
for Office 2003.
Searches for a value in the first column of a table array and returns a value in the same row from another column
in the table array.
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 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 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 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. If col_index_num is:
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.
Remarks
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 ( ' or " ) and curly ( ‘ or “)
quotation marks, or nonprinting characters. In these cases, VLOOKUP may give an incorrect or unexpected
value. For more information on functions that you can use to clean text data, see Text and Data functions.
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. For more information, see
Convert numbers stored as text to numbers.
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 1
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
This example searches the Density column of an atmospheric properties table to find corresponding values in the
Viscosity and Temperature columns. (The values are for air at 0 degrees Celsius at sea level, or 1 atmosphere.)
A B C
1 Density Viscosity Temperature
http://office.microsoft.com/en-001/excel-help/vlookup-HP005209335.aspx 1/4
5/17/2014 VLOOKUP - Excel
2 0.457 3.55 500
3 0.525 3.25 400
4 0.616 2.93 300
5 0.675 2.75 250
6 0.746 2.57 200
7 0.835 2.38 150
8 0.946 2.17 100
9 1.09 1.95 50
10
1.29 1.71 0
Example 2
The example may be easier to understand if you copy it to a blank worksheet.
A B C D
1 Item-ID Item Cost Markup
2 ST-340 Stroller $145.67 30%
3 BI-567 Bib $3.56 40%
4 DI-328 Diapers $21.45 35%
5 WI-989 Wipes $5.12 40%
6
AS-469 Aspirator $2.56 45%
Formula Description (result)
= VLOOKUP("DI-328", A2:D6, 3, Calculates the retail price of diapers by
FALSE) * (1 + VLOOKUP("DI-328", adding the markup percentage to the
A2:D6, 4, FALSE)) cost. ($28.96)
= (VLOOKUP("WI-989", A2:D6, 3, Calculates the sale price of wipes by
FALSE) * (1 + VLOOKUP("WI-989", subtracting a specified discount from
A2:D6, 4, FALSE))) * (1 - 20%) the retail price. ($5.73)
http://office.microsoft.com/en-001/excel-help/vlookup-HP005209335.aspx 2/4
5/17/2014 VLOOKUP - Excel
Example 3
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
This example searches the ID column of an employee table and matches values in other columns to calculate ages
and test for error conditions.
A B C D E
ID Last name First Title Birth date
name
1 Davolio Nancy Sales 12/8/1968
Representative
http://office.microsoft.com/en-001/excel-help/vlookup-HP005209335.aspx 3/4
5/17/2014 VLOOKUP - Excel
employee's last name;
otherwise, displays the
message "Employee
not found". (Employee
not found)
The ISNA function
returns a TRUE value
when the VLOOKUP
function returns the
#NA error value.
NOTE The first formula in the example above uses the YEARFRAC function. If this function is not available, and
returns the #NAME? error, install and load the Analysis ToolPak add-in.
How?
Site Directory Contact Us Submit Feedback Legal Trademarks Privacy and Cookies Accessibility © 2014 Microsoft Corporation. All rights reserved.
http://office.microsoft.com/en-001/excel-help/vlookup-HP005209335.aspx 4/4