LOOKUP function

Use LOOKUP, one of the lookup and reference functions, when you need to look in a single row or column and find a value from the same position in a second row or column.

For example, let's say you know the part number for an auto part, but you don't know the price. You can use the LOOKUP function to return the price in cell H2 when you enter the auto part number in cell H1.

An example of how you might use the LOOKUP function

There are two ways to use LOOKUP: Vector form and Array form

Vector form: Use this form of LOOKUP to search one row or one column for a value. Use the vector form when you want to specify the range that contains the values that you want to match. For example, if you want to search for a value in column A, down to row 6.

Example of a vector

Array form: We strongly recommend using VLOOKUP or HLOOKUP instead of the array form. Watch this video about using VLOOKUP. The array form is provided for compatibility with other spreadsheet programs, but it's functionality is limited.

An array is a collection of values in rows and columns (like a table) that you want to search. For example, if you want to search columns A and B, down to row 6. LOOKUP will return the nearest match. To use the array form, your data must be sorted.

Example of a table, which is an array

Vector form
The vector form of LOOKUP looks in a one-row or one-column range (known as a vector) for a value and returns a value from the same position in a second one-row or one-column range.

Syntax
LOOKUP(lookup_value, lookup_vector, [result_vector])

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.

Important: The values in lookup_vector must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP might not return the correct value. Uppercase and lowercase text are equivalent.

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.

Popular posts from this blog

Tamilnadu (TN01 - TN99) RTO Codes, Names, Address, Phone Numbers and Pin Code

Kerala (KL01 to KL73) RTO Codes for Vehicle Registration, Phone Numbers

Karnataka (KA01 to KA65) RTO Codes for Vehicle Registration, Phone Numbers