INDEX Function: Description
INDEX Function: Description
INDEX function
This article describes the formula syntax and usage of the INDEXfunction in Microsoft Excel.
Description
Returns a value or the reference to a value from within a table or range. There are two forms of the
INDEX function: the array form and the reference form.
If you want to Then see
Return the value of a specified cell or array of cells Array form
Return a reference to specified cells Reference form
Array form
Description
Returns the value of an element in a table or an array, selected by the row and column number
indexes.
Use the array form if the first argument to INDEX is an array constant.
Syntax
INDEX(array, row_num, [column_num])
The INDEX function syntax has the following arguments:
Array Required. 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 Required. Selects the row in array from which to return a value. If row_num is
omitted, column_num is required.
Column_num Optional. Selects the column in array from which to return a value. If
column_num is omitted, row_num is required.
Remark
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
https://support.office.microsoft.com/enus/article/INDEXfunctionb61bc266fe024852aad977bf8ca3c036?CorrelationId=a1427f6154054964bc47af9eb… 1/3
10/2/2015 Print Selection
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 CTRL+SHIFT+ENTER.
Note In Excel Web App you cannot create array formulas.
Row_num and column_num must point to a cell within array; otherwise, INDEX returns the
#REF! error value.
Examples
Copy the example data in each of the following tables, and paste it in cell A1 of a new Excel
worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to,
you can adjust the column widths to see all the data.
Example 1
These formulas use the INDEX function to find the value in the intersecting cell where a row and a
column meet.
Data Data
Apples Lemons
Bananas Pears
Formula Description Result
Value at the intersection of the second row and second
'=INDEX(A2:B3,2,2) =INDEX(A2:B3,2,2)
column in the range A2:B3.
Value at the intersection of the second row and first column
'=INDEX(A2:B3,2,1) =INDEX(A2:B3,2,1)
in the range A2:B3.
Example 2
This formula uses the INDEX function in an array formula to find the values in two cells specified in a
2x2 array.
Note The formula in cell C2 is an array formula. For this formula to return values in cells C2 and C3,
select C2 and C3, press F2, and then press CTRL+Shift+Enter. Otherwise, only a value in cell C2 will be
returned.
Example 3
https://support.office.microsoft.com/enus/article/INDEXfunctionb61bc266fe024852aad977bf8ca3c036?CorrelationId=a1427f6154054964bc47af9eb… 2/3
10/2/2015 Print Selection
Apples $0.69 40
Bananas $0.34 38
Lemons $0.55 15
Oranges $0.25 25
Pears $0.59 40
Almonds $2.80 10
Cashews $3.55 16
Peanuts $1.25 20
Walnuts $1.75 12
Formula Description Result
The intersection of the second row and third column in the range
=INDEX(A2:C6, 2, 3) 38
A2:C6, which is the contents of cell C3.
=INDEX((A1:C6, The intersection of the second row and second column in the second
3.55
A8:C11), 2, 2, 2) area of A8:C11, which is the contents of cell B9.
=SUM(INDEX(A1:C11, The sum of the third column in the first area of the range A1:C11,
216
0, 3, 1)) which is the sum of C1:C6.
The sum of the range starting at B2, and ending at the intersection of
=SUM(B2:INDEX(A2:C6,
the fifth row and the second column of the range A2:A6, which is the 2.42
5, 2))
sum of B2:B6.
https://support.office.microsoft.com/enus/article/INDEXfunctionb61bc266fe024852aad977bf8ca3c036?CorrelationId=a1427f6154054964bc47af9eb… 3/3