9] =INDEX
=INDEX is a function used to return the value of a specific cell in a table or range of cells, based on the specified row and column numbers. This function belongs to the Lookup and Reference category, and is one of the useful functions for retrieving data from different sources or for generating dynamic cell references.
The syntax of the =INDEX function is as follows:
=INDEX(array,row_num,[column_num])
Where:
- an array is a table or range of cells that contains the data you want to return. This table or range of cells must have at least one row and one column.
- row_num is the row number in a table or range of cells that contains the value you want to return. This line number must be a positive number, starting at 1 for the first row, 2 for the second line, and so on.
- [column_num] is the column number in the table or range of cells that contains the value you want to return. This column number must be a positive number, starting at 1 for the first column, 2 for the second column, and so on. If you leave this argument blank, the =INDEX function returns the entire row specified by the row_num.
Here is an example of using the =INDEX function:
A | B | C | D |
Name | Value | Information | Code |
Andi | 80 | Pass | A001 |
Mind | 70 | Pass | A002 |
Cici | 60 | Pass | A003 |
Dedi | 50 | Fail | A004 |
One | 40 | Fail | A005 |
- =INDEX(A1:D5,2,3) returns the text “Pass”, which is the returned value from cells that are in the second row and third column in the table or cell range A1:D5.
- =INDEX(A1:D5,4,0) returns cell range D4:D5, which is the entire row returned from the table or cell range A1:D5, based on the specified row number 4.
- =INDEX(A1:D5,0,4) returns cell range D1:D5, which is the entire column returned from the table or cell range A1:D5, based on the specified column number 4.
- =INDEX(A1:D5,5,2) returns the value 40, which is the returned value from cells that are in the fifth row and second column in the table or cell range A1:D5.