Wuya Tutorial-JavaScript-INDEX Function

describe

The INDEX function returns a value or a reference to the value from a table or range. You can use INDEX function in two ways -

  • Returns the value of the specified cell or cell array.
  • Returns a reference to the specified cell.

Use the INDEX function to return the value of a specified cell or cell array

Use this parameter if the first parameter of INDEX is an array constant.

describe

This function returns the value of an element in a table or array selected by row number and column number index.

grammar

INDEX (array, row_num, [column_num]) 

parameter

Argument describe Required/Optional
Array

Cell range or array constant.

If the array contains only one row or column, the corresponding Row_num or Column_num parameter is optional.

If the array has more than one row and more than one column, and only Row_num or Column_num is used, INDEX returns an array of the entire row or column in the array.

Required
Row_num

Select the row in the array from which to return a value. If Row_num is omitted, Column_num is required.

Required
Column_num

Select the column in the array from which to return a value.

If Column_num is omitted, Row_num is required.

Optional

Comment

  • If you use both the Row_num and Column_num parameters, INDEX returns the value in the cell at the intersection of Row_num and Column_num.

  • If Row_num or Column_num is set to 0 (zero), INDEX returns an array of values ​​for the entire column or row, respectively. To use values ​​returned as an array, enter the INDEX function as an array formula within a horizontal range of cells in a row and a vertical range of cells in a column. To enter an array formula, press CTRL + SHIFT + ENTER

  • Row_num and Column_num must point to cells in the array. Otherwise, INDEX will return the #REF! error value.

Use the INDEX function to return a reference to a specified cell

describe

This function returns a reference to the cell at the intersection of a specific row and column. If the reference consists of non-adjacent selections, you can select which selection to find.

grammar

INDEX (reference, row_num, [column_num], [area_num]) 

parameter

Argument describe Required/Optional
Reference

A reference to one or more cell ranges.

If you are entering a non-contiguous range for a reference, enclose the reference in parentheses.

If each range in the reference contains only one row or column, the Row_num or Column_num parameters respectively are optional. like. For single line quotes, use -

INDEX(reference , column_num)

Required
Row_num

The line number in the quote from which to return the quote.

Required
Column_num

The column number in the reference from which to return the reference.

Optional
Area_num

Select a reference range from which the intersection of Row_num and Column_num is returned. The first area selected or entered is numbered 1, the second area numbered 2, and so on.

If Area_num is omitted, INDEX uses area 1.

Optional

Comment

  • After Reference and Area_num select a specific range, Row_num and Column_num select a specific cell: Row_num 1 is the first row in the range, Column_num 1 is the first column, and so on. The reference returned by INDEX is the intersection of Row_num and Column_num.

  • If Row_num or Column_num is set to 0 (zero), INDEX returns a reference to the entire column or row, respectively.

  • Row_num, Column_num and Area_num must point to the cells in the reference. Otherwise, INDEX will return the #REF! error value. If Row_num and Column_num are omitted, INDEX returns the area in the reference specified by Area_num.

  • The output of the INDEX function is a reference and is interpreted through other formulas. Depending on the formula, the return value of INDEX can be used as a reference or value. For example, the formula CELL("width",INDEX(A1:B2,1,2)) is equivalent to CELL("width",B1). The CELL function uses the return value of INDEX as the cell reference. On the other hand, a formula such as 2 * INDEX(A1:B2,1,2) will convert the return value of INDEX into a number in cell B1.

applicability

Excel 2007,Excel 2010,Excel 2013,Excel 2016

Example

Index Function

INDEX function in JavaScript - Wuya Tutorial Network Wuya Tutorial Network provides a description of the INDEX function that returns a value or a reference to the value from a table or range. You can use the INDEX function in two ways... https://www.learnfk.com/javascript/advanced-excel-lookup-reference-index-function.html

Guess you like

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