How to Use the INDEX Function in Excel

The INDEX function in Excel and Google Sheets is a vital tool that retrieves the value of a cell within a given range, determined by specified row and column numbers. This function proves exceptionally beneficial when handling large datasets to pinpoint specific data based on particular criteria.

Basic Syntax

The syntax for the INDEX function is straightforward:

=INDEX(array, row_num, [column_num])
  • array: This is the cell range or array from which the value is extracted.
  • row_num: This defines the row in the array from which to extract the value.
  • column_num: (Optional) This identifies the column in the array from which to extract the value. If this parameter is omitted, the function returns the entire row specified by row_num.

Examples of Usage

Below are several examples to illustrate the utility of the INDEX function.

Example 1: Basic Usage

Imagine a dataset where column A lists student names and column B their respective scores. We aim to find the score for the student in the third row.

Name Score
John 85
Amy 92
Michael 78

The appropriate formula is:

=INDEX(B2:B4, 3)

This returns “78”, the score of the student in row 3.

Example 2: Retrieving a Specific Value

To refine the previous example, we want to fetch the score of the student named “Amy”.

This can be accomplished by combining the MATCH function with the INDEX function, as shown:

=INDEX(B2:B4, MATCH("Amy", A2:A4, 0))

This formula identifies “Amy” within the range A2:A4 and retrieves her score from column B.

Example 3: Returning an Entire Row

In some cases, the requirement may be to extract an entire row of data based on specific criteria. For instance, if we need all data for the student “John”:

=INDEX(A2:B4, MATCH("John", A2:A4, 0), 0)

This function call outputs the entire row of data relating to “John”.

These examples underscore the flexibility and efficacy of the INDEX function in Excel and Google Sheets, making it an indispensable tool for retrieving specific values, entire rows, or even columns as needed.

More information: https://support.microsoft.com/en-us/office/index-function-a5dcf0dd-996d-40a4-a822-b56b061328bd

Other functions
Returns a reference as text to a single cell in a worksheet
Returns the number of areas in a reference
Chooses a value from a list of values
Returns the column number of a reference
Returns the number of columns in a reference
Filters a range of data based on criteria you define
Returns the formula at the given reference as text
Returns data stored in a PivotTable report
Looks in the top row of an array and returns the value of the indicated cell
Creates a shortcut or jump that opens a document stored on a network server, an intranet, or the Internet
Returns a reference indicated by a text value
Looks up values in a vector or array
Looks up values in a reference or array
Returns a reference offset from a given reference
Returns the row number of a reference
Returns the number of rows in a reference
Retrieves real-time data from a program that supports COM automation
Sorts the contents of a range or array
Sorts the contents of a range or array based on the values in a corresponding range or array
Returns the transpose of an array
Returns a list of unique values in a list or range
Looks in the first column of an array and moves across the row to return the value of a cell
Searches a range or an array, and returns an item corresponding to the first match it finds If a match doesn't exist, then XLOOKUP can return the closest (approximate) match
Returns the relative position of an item in an array or range of cells