Use this method when you need to search in a single row or column and find a value from the same location in a second row or column. This function can be used in two ways. There are two types of arrays: vectors and arrays.
Vector Form
Use this form to look for a value in a single row or column. We’ll explain further with an example.
Array Form
This version of LOOKUP is offered for compatibility with other spreadsheet applications; however, its usefulness is restricted; instead, use VLOOKUP or HLOOKUP. LOOKUP’s array form is quite similar to the HLOOKUP and VLOOKUP routines.
The distinction is that HLOOKUP looks for the value of lookup value in the first row, VLOOKUP searches in the first column, and LOOKUP searches according to the array’s dimensions. The LOOKUP function has a restriction in that it always returns the latest value in the row or column; it does not return in-between values. As a result, you must use VLOOKUP or HLOOKUP.
Syntax:
LOOKUP(lookup_value, lookup_vector, [result_vector])
Parameter list:
Example :
Examine the sample file exceltovba.com-LOOKUP.xlsx Sheet1.
In this example, we first look for 14.19 in column A and then compare it to the number in column B in the same row. Second, we look for 15.75 in column A and, if it does not match, we match the next lower number (15.17) and return the value from column B that is in the same row. Third, we look for 17.66 in column A and, if it does not match, we match the next smaller number (16.39) and return the value from column B that is in the same row. Looks up 0 in column A and returns an error because 0 is less than the smallest number (14.14) in column A.
Ask Your Query