> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# RankPercentile

Rank the rows in the table by percentile using the input column.

## Usage

`RankPercentile(column, [direction])`

**column** (required) The column used to order the table. The input column can be numbers, dates or text.

**direction** (optional) The direction to sort the input column. Default is to sort ascending.

The [percentile](https://en.wikipedia.org/wiki/Percentile) is a number between 0 and 1. The last row is always 1 and the first is 0, unless there is only 1 row or there is a tie for the top value. To display the result as percentages as opposed to numbers, change the column formatting from Automatic to Percent.

## Example

`RankPercentile([Population by State])`

* This assigns the state with the smallest population rank 0, the largest population is assigned rank 1.

`RankPercentile([Population 2010])`

![Screenshot of results showing the county with the lowest population for each state ranked with 0.00% percentile and the county with the largest population ranked with 100.00%](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/eab63e41a583f90ef4eb0e4c5e4f7f00e28946a5bd8d8bafe015188d472ffb57/assets/docs-images/ed21ebd-11.png)

`RankPercentile([COUNTY - Count])`

![Screenshot of results showing states listed by count of counties, with the state that has fewest counties listed with a RankPercentile value of 0.00% and the most counties visible on this screenshot being Idaho with 37.25%.](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/6177608b2a0e4f405998ddccbf761fe0edc9fb3677b556748395d56db44e3fc7/assets/docs-images/ca7a4dc-22.png)

## Related resources

* [CumeDist](/docs/cumedist)
* [PercentileCont](/docs/percentilecont)
* [Rank](/docs/rank)
* [RankDense](/docs/rankdense)
* [RowNumber](/docs/rownumber)