The VLOOKUP Function looks up a value you designate in the first column of worksheet area and returns a value from the row it finds the lookup value on. Used to merge tables, construct dashboards and perform various data processing tasks.
The VLOOKUP function is a computer program that you run from a worksheet cell formula. It looks up a value you designate in the first column of worksheet area (called a range) and returns a value from the row it finds the lookup value on. In other words it is a standard table lookup that you learned in school. You run the VLOOKUP worksheet function by typing its name in a formula then followed by the information it is suppose to use. The VLOOKUP worksheet function is used in applications when you have to look up prices, name information, scientific data anything that is contained in a table. It can also be used to merge two tables together transferring information from one to the other. The V in VLOOKUP stands for vertical. There is also another function called HLOOKUP that looks along the first row of a table. Use VLOOKUP when your comparison values are located in the first column of the data that you want to find. Note that this function also has the capability to search for parts of text within other text when evaluating its lookup value.
Whenever you type a formula in a worksheet cell, this is called syntax or grammar. The general VLOOKUP function syntax has a format like this when you type it in a worksheet cell:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
Where lookup_value, table_array, col_index_num, [range_lookup] are called the function argument list. Remember, you are running a computer program at this point so the program needs information to operate and that is why there is an argument list. When you see an argument list and you see square brackets [ ] around the argument name, this means the argument is optional and you do not have to include it when typing unless you need it. So for the syntax above, you need to include 3 arguments for the VLOOKUP worksheet function when typing it in a worksheet cell formula in order for it to calculate correctly. What argument values can be used are discussed below. Remember functions expect certain things in their argument lists, if you do not put the correct information in the list they will generate an error when run.
* It is possible to name a cell or group of cells on a worksheet and use that name in place of a range reference or cell reference. Consult Excel help on how to name a cell.
Since the VLOOKUP function is a computer program, it runs when you press Enter to enter the formula that contains it. If any of the arguments are wrong, the function will return an error.
When typing the VLOOKUP function in a worksheet cell formula, you need to replace the argument list with arguments separating each one with a comma (,). Some typical arguments you can use are:
|=VLOOKUP("Widget1", A1:D5, 2, FALSE)||Find Widget1 in Column A then return information from Column B the row that Widget1 was found on|
|=VLOOKUP("*ST*", G1:J5, 4, FALSE)||Find the piece of text ST inside the cell value text in Column G then return information from Column J the row that ST was found on|
|=VLOOKUP("*" & B1 & "*", G1:J5, 2, FALSE)||Find the piece of text from the B1 cell value inside the text in Column G then return information from Column H the row that it was found on|
|=VLOOKUP(16, B1:D5, 2, FALSE)||Find number 16 in Column B then return information from Column C the row that 16 was found on|
|=VLOOKUP(B1, Prices, 3, FALSE)||Find the B1 cell value in range name Prices first column then return information from 3rd Column in range the row that B1 cell value was found on *|
* This function is used a great deal in building adaptive formulas that figure out ranges, start and stop of data.... It is also heavily used in dashboard design tying numeric ActiveX control outputs into formulas that seek out data in tables.
The worksheet seen below contains some typical worksheet formulas that run the VLOOKUP worksheet function. Pay close attention to the argument list and the syntax used to write the formula.
|1||Searching by Names|
|8||Look up name Widget1 in table and return cost. Formula below|
|9||Cost||$1.25||= VLOOKUP( "Widget1", A3:B6, 2, FALSE )|
|12||Cost||$1.25||= VLOOKUP( B11, A3:B6, 2, FALSE )|
|14||Item||Widget1||Allow user to search, use range name Widgets in place of A3:B6 much easier, can be on different sheet. Formula below|
|15||Cost||$1.25||= VLOOKUP( B14, Widgets, 2, FALSE )|
|18||Searching by Characters|
|25||Searches for X-ST1 in SKU# column, lookup value based on first 5 characters using an * after the characters, return cost. Formula below|
|26||Cost||$1.25||= VLOOKUP( "X-ST1*", A20:B23, 2, FALSE )|
|28||Searches for T3 in SKU# column, lookup value based on T3, using * before and after the characters, return cost. Formula below|
|29||Cost||$3.50||= VLOOKUP( "*T3*", A20:B23, 2, FALSE )|
|31||Search||T3||Searches for T3 in SKU# column, lookup value based on cell value B31 which is T3, using * before and after B31 and & to combine with *, return cost. Formula below|
|32||Cost||$3.50||= VLOOKUP( "*" & B31 & "*", A20:B23, 2, FALSE )|
|35||Searching by Numbers|
|36||InTake Temp (deg F)||Correction Factor|
|45||Using an approximate match, 4th argument omitted, searches for the value 99 in Column A and finds the closest match 95, returns .986. Formula below|
|46||Corr Factor||.986||= VLOOKUP( 99, A36:B44, 2 )|
|47||Using an exact match, 4th argument is FALSE, searches for the value 90 in Column A and returns error not found. Formula below|
|48||Corr Factor||#N/A||= VLOOKUP( 90, A36:B44, 2, False )|
|3||Widget1||$1.25||= VLOOKUP( A3, $D$2:$E$5, 2, False )||Widget1||X-ST1-100|
|6||Using an absolute match, use values in column A as lookup in column D to return SKU# to column C. Formula above|