How do I use the INDEX and MATCH functions in Excel?

INDEX and MATCH functions in Excel are often used together to look up a value in a table based on multiple criteria. Here is how you can use them:

### INDEX Function:
The INDEX function returns a value from within a range based on the row and column numbers you specify.
Syntax: `INDEX(array, row_num, [column_num])`
- `array`: The range of cells you want to return a value from.
- `row_num`: The row number within the array from which to return the value.
- `column_num`: (Optional) The column number within the array from which to return the value. If omitted, the function returns the entire row specified by row_num.

### MATCH Function:
The MATCH function searches for a specified value in a range and returns the relative position of that item.
Syntax: `MATCH(lookup_value, lookup_array, [match_type])`
- `lookup_value`: The value you want to match in the lookup_array.
- `lookup_array`: The range of cells to be searched.
- `match_type`: (Optional) Specifies the type of match - 1 for less than, 0 for an exact match, and -1 for greater than.

### Using INDEX and MATCH together:
1. Basic Example:
Let's say you have a table with student names in column A and their corresponding scores in column B. To find the score of a specific student, you can use:


=INDEX(B:B, MATCH("John", A:A, 0))


This formula will return the score of the student named "John" from column B.

2. Advanced Example:
If you have a table with multiple criteria (e.g., student name and subject), you can use INDEX and MATCH together:


=INDEX(C:C, MATCH(1, (A:A="John")*(B:B="Math"), 0))


Press `Ctrl + Shift + Enter` to make this an array formula. This formula returns the score of student "John" in the subject "Math" from column C.

Remember to adjust the cell references and ranges according to your specific data setup.
How do I use the INDEX and MATCH functions in Excel?

Related Questions