Add a rank column to a CSV based on a numeric column
Rank CSV rows by a numeric column and add a rank column with configurable tie-breaking.
🛡️ Your rows never leave your browser.
Why Onfyt: Supports within-group ranking: rank rows within each region or category separately—equivalent to SQL's RANK() OVER (PARTITION BY region ORDER BY revenue DESC).
Interactive Sample Data
| name | revenue |
|---|---|
| Grace Kerubo | 4500 |
| Peter Njoroge | 8200 |
| Mercy Akinyi | 3100 |
How this tool works
Ranking rows within a dataset is a common analytical operation: ranking customers by lifetime value, ranking products by sales volume, or ranking employees by performance score. SQL's RANK(), DENSE_RANK(), and ROW_NUMBER() window functions handle this in databases. DataFix brings this to CSV files.
Three ranking modes are supported: Standard (ties get the same rank; next rank skips: 1, 2, 2, 4), Dense (ties get the same rank; next rank doesn't skip: 1, 2, 2, 3), and Competition (like standard but commonly used in sports rankings).
Computing relative row ranks based on numerical or alphabetical ordering assigns percentile and ordinal rankings across competitive metrics, performance scores, and sales leaderboards.
Computing relative row rankings assigns ordinal and percentile ranks across competitive leaderboards, test scores, and sales performance metrics. Our ranking engine supports standard ranking, dense ranking, and fractional rankings with configurable tie-breaking rules.
Ordinal ranking options allow users to select between competition ranking (1224), dense ranking (1223), or ordinal ranking (1234), providing full compatibility with SQL window functions and competitive leaderboard requirements.
Computing ordinal or dense rankings across records creates structured leaderboards and performance tiers. Customizable tie-breaking rules ensure deterministic ranking outcomes for competitive metrics. Multi-column ranking enables secondary tie-breaking attributes (such as ranking by revenue first, then by customer seniority) with complete deterministic precision. Dense ranking options prevent skipped index ranks when identical values share matching rank positions.
Things that usually go wrong
- Ties produce the same rank in standard ranking — if you need unique ranks, use row-number ranking.
- Ranking requires the column to contain comparable values (all numeric or all text).
Edge cases we tested
🧪 Two rows with identical revenue (tie)
Both get same rank; next row gets rank+2 in standard mode, rank+1 in dense mode.
🧪 Tied identical values in ranking column
Handles ties via standard dense ranking (1,2,2,3) or fractional ranking.
Frequently Asked Questions
What is dense ranking?
In dense ranking, the rank after a tie group increases by 1 (not by the size of the group). E.g. 1, 2, 2, 3 instead of 1, 2, 2, 4.
Can I rank in ascending order?
Yes — lowest value gets rank 1 in ascending mode, highest value gets rank 1 in descending mode.
Related tools
Analyze
Count Word Frequency
Count word frequency across a text column in a CSV and output a frequency table.
Open Tool →
Analyze
Count Unique Values
Count distinct values per CSV column and generate a value-count frequency table for each.
Open Tool →
Analyze
Top N Values in a Column
Extract the top N or bottom N rows from a CSV ranked by a numeric column.
Open Tool →