The INDEX function in Google Sheets is a powerful tool that allows users to fetch the content of a cell from a specified range. This function is particularly useful when working with large datasets, where direct cell references may be cumbersome. By providing the function with the correct row and column indices, users can easily extract specific data points from their sheets.
Syntax
INDEX(reference, row, [column])
- reference: The range of cells from which you want to extract data.
- row: The row number from which to retrieve a value, counting from the top of the range.
- column: (Optional) The column number from which to retrieve a value, counting from the left of the range.
Example #1
=INDEX(A1:C3, 2, 3)
This function retrieves the value from the second row and third column of the range A1:C3. For example, if A1:C3 contains the values {1,2,3; 4,5,6; 7,8,9}, the result will be 6.
Example #2
=INDEX(A1:B5, 4, 1)
This function fetches the value located at the fourth row and the first column of the range A1:B5. If the values in A1:B5 are {A, B; C, D; E, F; G, H; I, J}, then the result will be G.
Example #3
=INDEX(D1:D10, 5)
This function retrieves the value from the fifth row of the range D1:D10. If D1:D10 contains values like {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, then the result will be 50.
Error handling
- REF!: This error occurs when the row or column number specified in the function exceeds the dimensions of the given reference range.
- VALUE!: This error happens when either the row or column parameter is provided with a non-numeric value.
- N/A: This error indicates that the specified row is empty, meaning the function cannot find a value in that location.