ExcelFunctions.net Logo

The Excel INDEX Function

Home » Excel-Built-In-Functions » Excel-Lookup-And-Reference-Functions » Excel-Index-Function
Search this site:
Custom Search

Basic Description

The Excel INDEX function returns a reference to a cell that lies in a specified row and column of a user-supplied range of cells.

There are two formats of the function, which are the Array Format (which is the most basic format), and the Range Format of the function. These are covered separately below.

The Array Format of the Excel INDEX Function

The Array format of the Index function is the most basic form of the function, and is used when you want to look up a reference to a cell within a single range.

The syntax of the function is :

INDEX( array, row_num, col_num )

Where the arguments are as follows :

array - The specified array or range of cells
row_num - Denotes the row number of the specified array
If set to zero or blank, this defaults to all rows in the supplied array
col_num - Denotes the column number of the specified array
If set to zero or blank, this defaults to all columns in the supplied array

The function is best explained through the following examples:

Example 1

In the following example, the Index function returns a reference to row 5 of the supplied range, which is cell C5. This evaluates to the value 8

 Formula
Example of use of the Excel Index function
 Result
Excel Index Function Result

Example 2

In the following example, the Index function returns a reference to row 5 and column 2 of the supplied range, which is cell D5. This evaluates to the value 3

 Formula
Example of use of the Excel Index function
 Result
Excel Index Function Result

Example 3

In the following example, as the supplied col_num is set to 0, the Index function returns a reference to all of row 5 of the supplied range, which is the range C5:D5.

The sum of this range evaluates to the value 11

 Formula
Example of use of the Excel Index function
 Result
Excel Index Function Result
Array Formulas:
To input an array formula, you need to first highlight the range of cells for the function result. Type your function into the first cell of the range, and press CTRL-SHIFT-Enter.

Go to the Excel Array Formulas page for more details.

Example 4

In the following example, the supplied row_num is set to 0, and so the Index function returns a reference to all of column 2 of the supplied range. I.e. the function returns a reference to the range D1:D5.

In this case, the function is input into cells A1:A5, as an Array Formula. Therefore, the values of the five cells returned by the Index function are displayed in cells A1:A5.


 Formula
Example of use of the Excel Index function
 Result
Excel Index Function Result

The Range Format of the Excel INDEX Function

The Range format of the Index function can be used to extract references from ranges that are made up of more than one area.

The format of the function is :

INDEX( range, row_num, col_num, area_num )

Where the arguments are as follows :

array - The specified range of cells
Note: If multiple areas are input directly into the function, the individual areas should be separated by commas and surrounded by brackets - ie. ( A1:B2, C3:D4, etc)
row_num - Denotes the row number of the specified array
If set to zero or blank, this defaults to all rows in the supplied array
col_num - Denotes the column number of the specified array
If set to zero or blank, this defaults to all columns in the supplied array
area_num - If the initial specified range is made up of more than one area, the area_num argument specifies the number of the area to be used
(Note that the areas are numbered by the order they are specified)

This form of the Index function is illustrated via the following examples:

Example 1

In the following example, the Index function returns a reference to row 4 and column 2 of the 1st area (ie. C1:D5) in the supplied range. This is cell D4. This evaluates to the value 5

 Formula
Example of use of the Excel Index function
 Result
Excel Index Function Result

Example 2

In the following example, the Index function returns a reference to row 3 and column 1 of the 3rd area (ie. B10:D12) in the supplied range. This is cell B12, which evaluates to the value 7

 Formula
Example of use of the Excel Index function
 Result
Excel Index Function Result

Example 3

In the following example, as the supplied col_num is blank, the Index function returns a reference to all of row 3 of the 3rd area (ie. B10:D12) of the supplied range. This is the range B12.

The sum of this range evaluates to the value 10.

 Formula
Example of use of the Excel Index function
 Result
Excel Index Function Result

Further information and examples of the Excel Index function can be found on the Microsoft Office website.


Index Function Errors

If you get an error from the Excel Index function this is likely to be one of the following:

Common Errors
#REF! - Occurs if either:
-the supplied row_num argument is greater than the number of rows in the supplied range
-the supplied col_num argument is greater than the number of columns in the supplied range
-the supplied area_num argument is greater than the number of areas in the supplied range
#VALUE! - Occurs if any of the supplied row_num, col_num or area_num arguments are not numeric values




Valid XHTML 1.0 Transitional
Disclaimer Privacy Policy

Copyright © 2008-2011 ExcelFunctions.net