INDEX (reference) function

Returns the reference of the cell at the intersection of a particular row and column. If the reference is made up of nonadjacent selections, you can pick the selection to look in.

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. This topic describes the reference syntax form. For information on the array form, see INDEX (array) function.

Syntax

INDEX(reference, row_num, column_num, area_num )

Argument Description Remarks
reference A reference to one or more cell ranges.
  • If you are entering a nonadjacent selection for reference, enclose reference in parentheses.
  • If each area in reference contains only one row or column, the row_num or column_num argument, respectively, is optional. For example, for a single row reference, use INDEX(reference,, column_num ).
row_num The number of the row in reference from which to return a reference.
  • If you set row_num to 0 (zero), INDEX returns the reference for the entire row.
column_num The number of the column in reference from which to return a reference.
  • If you set column_num to 0 (zero), INDEX returns the reference for the entire column.
area_num Selects a range in reference from which to return the intersection of row_num and column_num.
  • The first area selected or entered is numbered 1, the second is 2, and so on.

For example, if reference describes the cells (A1:B4,D1:E4,G1:H4), then area_num 1 is the range A1:B4, area_num 2 is the range D1:E4, and area_num 3 is the range G1:H4.

  • If area_num is omitted, INDEX uses area 1.

General remarks

  • After reference and area_num have selected a particular range, row_num and column_num select a particular 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.
  • The arguments row_num, column_num, and area_num must point to a cell within reference; otherwise, INDEX returns the #REF! error value. If row_num and column_num are omitted, INDEX returns the area in reference specified by area_num.
  • The result of the INDEX function is a reference and is interpreted as such by other formulas. Depending on the formula, the return value of INDEX may be used as a reference or as a 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 a cell reference. On the other hand, a formula such as 2*INDEX(A1:B2, 1, 2 ) translates the return value of INDEX into the number in cell B1.

Example

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.

Fruit Price Count
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)  
=INDEX(A2:C6, 2, 3 ) The intersection of the second row and third column in the range A2:C6, which is the content of cell C3 (38)  
=INDEX((A1:C6,A7:C10), 2, 2, 2 ) The intersection of the second row and second column in the second area (A7:C10), which is the content of cell B8 (3.55)  
=SUM(INDEX(A1:C10,0,3,1)) The sum of the third column in the range A1:C10, which is the sum of C1:C6 (216)  
=SUM(B2:INDEX(A2:C6,5,2)) The sum of the range starting at B2, and ending at the intersection of the fifth row and the second column of the range A2:A6, which is the sum of B2:B6 (2.42)  

See also

INDEX (array) function

List of all functions (by category)

VLOOKUP function

MATCH function

 
 
Applies to:
Excel for Mac 2011