Applies To: Excel 2016, Excel 2013, Excel 2010, Excel 2007, Excel 2016 for Mac, More...
Description
The Excel LOOKUP function use to returns the corresponding value from a range (one-row or one-column) or from an array range.
There are two ways to use LOOKUP function with diffrent syntax
Vector form (Syntax #1)
The LOOKUP function use to searches for value in the lookup_range (single row-range or colume-range) and returns the value in the result_range that is in the same position with lookup value.
In this form LOOKUP function use to search one-row or one-column for lookup a value. Use the vector form of LOOKUP Function when you want to specify the range that contains the values that you want to match.
When we use LOOKUP to looks in only single row or single column range (known as a vector) for a value and returns a value from the given range with same position in a second one-row or one-column range.
LOOKUP Function (Syntax #1)
LOOKUP( value, lookup_range, [result_range] )
Parameters or Arguments (Syntax #1)
The LOOKUP function vector form syntax has the following arguments:
- lookup_value Required. A value that LOOKUP searches for in the first vector. Lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.
- lookup_vector Required. A range that contains only one row or one column. The values in lookup_vector can be text, numbers, or logical values.
- result_vector Optional. A range that contains only one row or column. The result_vector argument must be the same size as lookup_vector. It has to be the same size.
Remarks:
- If the LOOKUP function can't find the lookup_value, the function matches the largest value in lookup_vector that is less than or equal to lookup_value.
- If lookup_value is smaller than the smallest value in lookup_vector, LOOKUP returns the #N/A error value.
- If the values in the LOOKUP_range are not sorted in ascending order, the LOOKUP function will return the incorrect value.
Vector examples
Array form (Syntax #2)
With Array form the LOOKUP function searches for the value in the first row or column of the array and returns the corresponding value in the last row or column of the array. Use this form of LOOKUP when the values that you want to match are in the first row or column of the array.
We strongly recommend using VLOOKUP or HLOOKUP instead of the array form. The array form is provided for compatibility with other spreadsheet programs, but it's functionality is limited.
LOOKUP Function (Syntax #2)
LOOKUP( lookup_value, array )
Parameters or Arguments (Syntax #2)
The
LOOKUP function Array form syntax has the following arguments:
- lookup_value Required. A value that LOOKUP searches for in an array. The lookup_value argument can be a number, text, a logical value, or a name or reference that refers to a value. The value to search for in the array. The values must be in ascending order.
- If LOOKUP can't find the value of lookup_value, it uses the largest value in the array that is less than or equal to lookup_value.
- If the value of lookup_value is smaller than the smallest value in the first row or column (depending on the array dimensions), LOOKUP returns the #N/A error value.
- array Required. A range of cells that contains text, numbers, or logical values that you want to compare with lookup_value. An array of values that contains both the values to search for and return.
Remarks:
- If the LOOKUP can not find an exact match, it chooses the largest value in the array that is less than or equal to the value.
- If the value is smaller than all of the values in the array, then the LOOKUP function will return #N/A.
- If the values in the array are not sorted in ascending order, the LOOKUP function will return the incorrect value.
Array examples