# Get Index

## Content

This function is used to get the index of the spilled cells.

## Syntax

`R.INDEX(cell, [context_cell])`

## Arguments

This function has the following arguments:

| **Argument** | **Description** |
| -------- | ----------- |
| *cell* | [Required] Specify the cell that you want to get the index. |
| *context\_cell* | [Optional] Specify the cell for which you set the context. if the context cell has been specified, this function will return the cell index in the context. |

## Example

```auto
// Use the formula(R.Index) to get the index of the spilled cells.
templateSheet.setFormula(1, 3, "R.INDEX(C2)");
templateSheet.setFormula(1, 4, "R.INDEX(C2,A2)");
templateSheet.setFormula(1, 5, "R.INDEX(A2)");
```

The output of the above code will look like below.
![image](https://gcdocumentsitekrblob.blob.core.windows.net/document-site-files/images/d37fbce1-6a37-43ce-b728-dd79fba68421/image.9b9dbf.png?width=1190)