Wuya Tutorial-JavaScript-LOOKUP Function

describe

Use the LOOKUP function when you need to look at a single row or column and find a value from the same location in a second row or column. Use the Find function to search a row or column.

Use the VLOOKUP function to search a row or column, or multiple rows and columns (such as a table). It is an improved version of LOOKUP.

There are two ways to use LOOKUP -

矢量形式 − 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.

数组形式 − Microsoft strongly recommends using VLOOKUP or HLOOKUP instead of the array form. The array form is provided for compatibility with other spreadsheet programs, but its functionality is limited.

An array is a collection of values ​​in rows and columns (such as a table) to be searched.

To use array form, the data must be sorted.

vector form

The vector form of LOOKUP looks for a value (called a vector) in a single row or column range and returns the value from the same position in a second single row or column range.

grammar

LOOKUP (lookup_value, lookup_vector, [result_vector]) 

parameter

Argument describe Required/Optional
lookup_value

The value that LOOKUP searches for in lookup_vector. Lookup_value can be a number, text, logical value or a name or reference to a reference value.

Required
lookup_vector

A range that contains only one row or column. Values ​​in lookup_vector can be text, numbers or logical values.

The values ​​in lookup_vector must be in ascending order:...,-2,-1,0,1,2...AZ,FALSE,TRUE. Otherwise, LOOKUP may not return the correct value. Uppercase and lowercase text are equivalent.

Required
result_vector

A range containing only one row or column. The result_vector parameter must be the same size as the lookup_vector.

Optional

Comment

  • If the LOOKUP function cannot find the lookup_value, the function will match the largest value in the lookup_vector that is less than or equal to the lookup_value.

  • If lookup_value is less than the minimum value in lookup_vector, LOOKUP returns the error value #N/A.

  • If lookup_vector is not in ascending order, LOOKUP returns the error value #N/A.

  • If the LOOKUP function attempts to reference a cell that does not exist, LOOKUP returns #REF!. Error value. That is when

    • Enter the cells you want to delete after entering the find function.

    • Relative references in the Lookup function will be invalid when the function is copied to other cells.

  • If the contents of the cells being compared have different data types, LOOKUP may not return the correct value.

  • LOOKUP may not return the correct value if there are invisible spaces at the beginning or end of the lookup_value or in the cells of the lookup_vector.

Array form

You may consider using VLOOKUP or HLOOKUP instead of the array form. The array form of LOOKUP is provided for compatibility with other spreadsheet programs, but its functionality is limited. The array form of LOOKUP looks for the specified value in the first row or column of the array and returns a value from the same position in the last row or column of the array.

Use this form of LOOKUP when the value you want to match is in the first row or column of the array.

grammar

LOOKUP (lookup_value, array) 

parameter

Argument describe Required/Optional
lookup_value

The value that LOOKUP searches for in the array.

Lookup_value can be a number, text, logical value or a name or reference to a reference value.

Required
array

A range of cells containing text, numbers, or logical values ​​that you want to compare to lookup_value.

The values ​​in the array must be in ascending order:...,-2,-1,0,1,2...AZ,FALSE,TRUE.

Otherwise, LOOKUP may not return the correct value.

Uppercase and lowercase text are equivalent.

Required

Comment

  • If the LOOKUP function cannot find the lookup_value, the function will match the largest value in the array that is less than or equal to the lookup_value.

  • If lookup_value is less than the smallest value in the first row or column (depending on the array dimensions), LOOKUP returns the error value #N/A.

  • If the LOOKUP function attempts to reference a cell that does not exist, LOOKUP returns #REF!. Error value. That is when

    • Enter the cells you want to delete after entering the find function.

    • Relative references in the Lookup function will be invalid when the function is copied to other cells.

  • If the contents of the cells being compared have different data types, LOOKUP may not return the correct value.

  • LOOKUP may not return the correct value if there are invisible spaces at the beginning or end of the lookup_value or in the cells of the array.

  • The array form of LOOKUP is very similar to the HLOOKUP and VLOOKUP functions. The difference is that HLOOKUP searches for the value of lookup_value in the first row, VLOOKUP searches in the first column, and LOOKUP searches based on the dimensions of the array.

    • If the area covered by the array is greater than its height (more columns than rows), LOOKUP searches the first row for the value of lookup_value.

    • If the array is square or larger than the array (more rows than columns), LOOKUP searches in the first column.

    • Using the HLOOKUP and VLOOKUP functions, you can go down or across the index, but LOOKUP always selects the last value in a row or column.

applicability

Excel 2007,Excel 2010,Excel 2013,Excel 2016

Example

vector form

Lookup vector form Function

Array form

Lookup array form Function

LOOKUP function in JavaScript - Wuya Tutorial Network Wuya Tutorial Network provides a description. Use the LOOKUP function when you need to look at a single row or column and find a value from the same position in the second row or column. ... https://www.learnfk.com/javascript/advanced-excel-lookup-reference-lookup-function.html

Guess you like

Origin blog.csdn.net/w116858389/article/details/132909898