[]
        
(Showing Draft Content)

Get Rank

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

Syntax

R.RANK(cell,[context_cell],[order],[rank_mode])

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 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:

  • R.Rank(C2) returns the rank of the current month's sales for all months of all years.

  • R.Rank(C2, A2) returns the rank of the current month's sales for all months of the current year.

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

Example

// 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.

RS-GetRankReport