0% found this document useful (0 votes)
70 views7 pages

IF (BM11 9500, BM11/202 4, IF (BM11 9000,176.8, IF (BM11 8000,168.9, IF (BM11 7000,165.3,163.5) ) ) ) Vlookup

The document describes the VLOOKUP function in Excel. VLOOKUP searches for a value in the first column of a table array and returns a value from the same row in a specified column. It takes in parameters for the lookup value, table array, column index number, and whether an exact or approximate match is required. Examples demonstrate searching for values and returning corresponding data from other columns in the table.

Uploaded by

raju amireddy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views7 pages

IF (BM11 9500, BM11/202 4, IF (BM11 9000,176.8, IF (BM11 8000,168.9, IF (BM11 7000,165.3,163.5) ) ) ) Vlookup

The document describes the VLOOKUP function in Excel. VLOOKUP searches for a value in the first column of a table array and returns a value from the same row in a specified column. It takes in parameters for the lookup value, table array, column index number, and whether an exact or approximate match is required. Examples demonstrate searching for values and returning corresponding data from other columns in the table.

Uploaded by

raju amireddy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

=IF(BM11>9500,BM11/202*4,IF(BM11>9000,176.

8,IF
(BM11>=8000,168.9,IF(BM11>=7000,165.3,163.5))))

VLOOKUP
Hide All

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 (array: Used to build single formulas that

produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array

range shares a common formula; an array constant is a group of constants used as an argument.). 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:

Less than 1, VLOOKUP returns the #VALUE! error value.

Greater than the number of columns in table_array, VLOOKUP returns the #REF! error value.
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. For more information, see Sort data.

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, see CLEAN and TRIM.

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

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic.

 NOTE    Do not select the row or column headers.

Selecting an example from Help

3. Press CTRL+C.

4. In the worksheet, select cell A1, and press CTRL+V.

5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+`

(grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

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

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

Formula Description (result)

=VLOOKUP(1,A2:C10,2) Using an approximate match, searches for the value 1 in


column A, finds the largest value less than or equal to 1 in
column A which is 0.946, and then returns the value from
column B in the same row. (2.17)

=VLOOKUP(1,A2:C10,3,TRUE) Using an approximate match, searches for the value 1 in


column A, finds the largest value less than or equal to 1 in
column A, which is 0.946, and then returns the value from
column C in the same row. (100)

=VLOOKUP(.7,A2:C10,3,FALSE) Using an exact match, searches for the value .7 in column A.


Because there is no exact match in column A, an error is
returned. (#N/A)

=VLOOKUP(0.1,A2:C10,2,TRUE Using an approximate match, searches for the value 0.1 in


) column A. Because 0.1 is less than the smallest value in
column A, an error is returned. (#N/A)

=VLOOKUP(2,A2:C10,2,TRUE) Using an approximate match, searches for the value 2 in


column A, finds the largest value less than or equal to 2 in
column A, which is 1.29, and then returns the value from
column B in the same row. (1.71)

Example 2

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1. Create a blank workbook or worksheet.

2. Select the example in the Help topic.

 NOTE    Do not select the row or column headers.

Selecting an example from Help

3. Press CTRL+C.

4. In the worksheet, select cell A1, and press CTRL+V.

5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+`

(grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
This example searches the Item-ID column of a baby products table and matches values in the Cost and Markup

columns to calculate prices and test conditions.

  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, FALSE) * (1 Calculates the retail price of diapers by


+ VLOOKUP("DI-328", A2:D6, 4, FALSE)) adding the markup percentage to the cost.
($28.96)

= (VLOOKUP("WI-989", A2:D6, 3, FALSE) * Calculates the sale price of wipes by


(1 + VLOOKUP("WI-989", A2:D6, 4, FALSE))) subtracting a specified discount from the
* (1 - 20%) retail price. ($5.73)

= IF(VLOOKUP(A2, A2:D6, 3, FALSE) >= 20, If the cost of an item is greater than or
"Markup is " & 100 * VLOOKUP(A2, A2:D6, 4, equal to $20.00, displays the string "Markup
FALSE) &"%", "Cost is under $20.00") is nn%"; otherwise, displays the string "Cost
is under $20.00". (Markup is 30%)

= IF(VLOOKUP(A3, A2:D6, 3, FALSE) >= 20, If the cost of an item is greater than or
"Markup is: " & 100 * VLOOKUP(A3, A2:D6, equal to $20.00, displays the string Markup
4, FALSE) &"%", "Cost is $" & VLOOKUP(A3, is nn%"; otherwise, displays the string "Cost
A2:D6, 3, FALSE)) is $n.nn". (Cost is $3.56)

Example 3

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1. Create a blank workbook or worksheet.

2. Select the example in the Help topic.

 NOTE    Do not select the row or column headers.


Selecting an example from Help

3. Press CTRL+C.

4. In the worksheet, select cell A1, and press CTRL+V.

5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+`

(grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

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

1 Last First Birth


ID name name Title date
2
1 Davolio Nancy Sales 12/8/1968
3 Rep.

4 2 Fuller Andrew V.P. 2/19/1952


of
Sales
5

3 Leverling Janet Sales 8/30/1963


6 Rep.

7 4 Peacock Margaret Sales 9/19/1958


Rep.

5 Buchanan Steven Sales 3/4/1955


Mgr.

6 Suyama Michael Sales 7/2/1963


Rep.

Formula Description (result)

=INT(YEARFRAC(DATE(2004,6,30), For the fiscal year 2004, finds


VLOOKUP(5,A2:E7,5, FALSE), 1)) the age of the employee with
ID equal to 5. Uses the
YEARFRAC function to
subtract the birth date from
the fiscal year end date and
displays the result as an
integer using the INT
function. (49)
=IF(ISNA(VLOOKUP(5,A2:E7,2,FALSE)) = If there is an employee with
TRUE, "Employee not found", an ID of 5, displays the
VLOOKUP(5,A2:E7,2,FALSE)) employee's last name;
otherwise, displays the
message "Employee not
found". (Buchanan)

The ISNA function returns a


TRUE value when the
VLOOKUP function returns
the #NA error value.

=IF(ISNA(VLOOKUP(15,A3:E8,2,FALSE)) = If there is an employee with


TRUE, "Employee not found", an ID of 15, displays the
VLOOKUP(15,A3:E8,2,FALSE)) 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.

=VLOOKUP(4,A2:E7,3,FALSE) & " " & For the employee with an ID


VLOOKUP(4,A2:E7,2,FALSE) & " is a " & of 4, concatenates the values
VLOOKUP(4,A2:E7,4,FALSE) & "." of three cells into a complete
sentence. (Margaret Peacock
is a Sales Representative.)

You might also like