[]
This function is used to get the rank of the spilled cells.
R.RANK(cell,[context_cell],[order],[rank_mode])
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 context cell. Example: If the A2 cell is bound to the year column, B2 cell is bound to the month column, C2 cell is bound to the sales column, then the result will be as follows:
|
order | [Optional] Specify the sort order type, the default value is descending. 0: Descending order 1: Ascending order |
rank_mode | [Optional] Specify the rank mode, the default value is no-parallel ranking. 0: Parallel no-skipping numbers 1: No-parallel ranking 2: Parallel skipping numbers |
// Use the formula(R.Rank) to get the rank of the spilled cells.
templateSheet.setFormula(1, 3, "R.RANK(C2)");
templateSheet.setFormula(1, 4, "R.INDEX(C2,A2)");
The output of the above code will look like below.