Returns a value of an element in a table or an
arrayA set of data used to build single formulas that produce multiple results or that operate on a group of arguments arranged in rows and columns. Excel
has two kinds of arrays: array ranges and array constants. An array range is a rectangular area of cells that share a common formula; an array constant is a specially arranged group of constants that's used as an argument in a formula., selected by the row and column number indexes.
The
INDEX function has two syntax forms: array and reference. The array form always returns a value or an array of values; the reference form always returns a reference. Use the array form if the first argument to
INDEX is an array constant. This topic describes the array syntax form. For information on the the reference form, see
INDEX (reference) function.
Syntax
INDEX(array,row_num,column_num)
Argument | Description | Remarks |
|---|
array | A range of cells or an array constant. | -
If
array contains only one row or column, the corresponding
row_num or
column_num argument is optional.
-
If
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
array.
|
row_num | Selects the row in
array from which to return a value. | -
If
row_num is omitted,
column_num is required.
-
This argument must point to a cell within array; otherwise, this function returns the #REF! error value.
|
column_num | Selects the column in
array from which to return a value. | -
If
column_num is omitted,
row_num is required.
-
This argument must point to a cell within array; otherwise, this function returns the #REF! error value.
|
-
If both the
row_num and
column_num arguments are used,
INDEX returns the value in the cell at the intersection of
row_num and
column_num.
-
If you set
row_num or
column_num to 0 (zero),
INDEX returns the 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 in a horizontal range of cells for a row, and in a vertical range of cells for a column. To enter an array formula, press
⌘+RETURN.
 | Example 1: Return a value from a range of cells |
To make the following example easier to understand, you can copy the data to a blank sheet and then enter the function underneath the data. Do not select the row or column headings (1, 2, 3... A, B, C...) when you copy the sample data to a blank sheet.
 | | 1 | | 2 | | 3 |
| | A | B | | Data | Data | | Apples | Lemons | | Bananas | Pears | | Formula | Description (Result) | | =INDEX(A2:B3,2,2) | Value at the intersection of the second row and second column in the range (Pears) | | =INDEX(A2:B3,2,1) | Value at the intersection of the second row and first column in the range (Bananas) |
|
 | Example 2: Return a value from an array |
To make the following example easier to understand, you can copy the data to a blank sheet and then enter the function underneath the data. Do not select the row or column headings (1, 2, 3... A, B, C...) when you copy the sample data to a blank sheet.
 | Note The formula in the example must be entered as an array formula. First, type the formula into cell A2 and then press
RETURN. The single result is 2. Next, select the range A2:A3, press
CONTROL+U, and then press
⌘+RETURN. The array result is 4. |
 | | 1 | | 2 | | 3 |
| | A | B | | Formula | Description (Result) | | =INDEX({1,2;3,4},0,2) | Value in the first row, second column in the array constant (2) | | | Value in the second row, second column in the array constant (4) |
|