Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Arrange by Rank in Excel: Step-by-Step

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To arrange by rank in Excel, you first need a rank value for each row, then sort by that rank. The quickest way is to add a helper column with the RANK.EQ function, then use Data > Sort to order by that column. This works for numbers, scores, sales figures, or any metric where you want a position from highest to lowest (or lowest to highest). You do not need any add-ins or advanced features—just a table of data and a spare column.

What You'll Need

  • Excel 2010 or later (RANK.EQ is available from Excel 2010 onward; older versions use RANK, which works the same way).
  • A dataset with at least one numeric column to rank by (e.g., scores, sales, times).
  • An empty column next to your data for the rank formula.
  • Optional: a table formatted with Ctrl+T (Insert > Table) to make sorting and formulas easier to manage.

Step-by-Step

  1. Set up your data. Make sure your numbers are in a single column with a header, and that there are no blank rows or merged cells. If your data is in a formatted table (Ctrl+T), the steps below still work; just use the table column references.
  2. Add a helper column. Click the first empty cell to the right of your data (e.g., cell C2 if your numbers are in B2:B100). Type a header such as Rank in C1.
  3. Enter the RANK.EQ formula. In C2, type =RANK.EQ(B2,$B$2:$B$100,0). Here B2 is the number you want to rank, $B$2:$B$100 is the entire range of numbers (locked with dollar signs so it does not shift when you copy down), and 0 means descending order (largest number gets rank 1). Use 1 for ascending order (smallest gets rank 1). Press Enter.
  4. Copy the formula down. Drag the fill handle (the small square at the bottom-right of cell C2) down to the last row of your data. Alternatively, double-click the fill handle to auto-fill down to the last adjacent row. Every row now has a rank.
  5. Check for ties. RANK.EQ gives tied values the same rank and skips the next rank (e.g., two 2nd places, then 4th). If you need unique ranks without gaps, use =RANK.EQ(B2,$B$2:$B$100,0)+COUNTIF($B$2:B2,B2)-1 instead. This adds a count of earlier duplicates, so each row gets a distinct number.
  6. Select the entire data range including the helper column. Click any cell in your data, then press Ctrl+A (or Ctrl+Shift+End) to select the whole block. Make sure the header row is included.
  7. Open the Sort dialog. Go to Data > Sort. In the Sort by dropdown, choose your helper column header (e.g., Rank). Set Order to Smallest to Largest so rank 1 appears at the top. If you want the highest number first, you would have used 1 in the RANK.EQ formula and then sort smallest to largest—the logic stays consistent.
  8. Confirm the range has headers. In the Sort dialog, tick My data has headers if it is not already ticked. This prevents Excel from treating your header row as data.
  9. Click OK. Excel rearranges the rows so they are ordered by rank. The original row order is lost, so if you need to preserve it, copy the data to a new sheet before sorting or add an index column with sequential numbers first.
  10. Optional: remove the helper column. Once sorted, you can delete the Rank column if you no longer need it. The rows stay in their new order.

Note: Menu labels can differ slightly by Excel version, platform (Windows, Mac, web), and region. The steps above describe the desktop Windows version; on Mac, the Sort dialog is under Data > Sort and looks similar. In Excel for the web, the same RANK.EQ function works, but the Sort dialog is under the Home tab's Sort & Filter button.

Common Mistakes

  • Forgetting absolute references. If you write =RANK.EQ(B2,B2:B100,0) without dollar signs, copying the formula down will shift the range and produce wrong ranks. Always lock the range with $.
  • Sorting only one column. If you select just the rank column and sort, Excel may ask to expand the selection—click Expand the selection to keep rows intact. Otherwise, your data will be scrambled.
  • Ignoring ties. RANK.EQ leaves gaps after ties. If you need a clean 1,2,3 sequence, use the COUNTIF adjustment shown in step 5.
  • Ranking text or blanks. RANK.EQ ignores text and empty cells, but if your range contains errors (#N/A), the formula returns an error. Clean the data first.
  • Using RANK instead of RANK.EQ. Both work, but RANK is kept for compatibility. RANK.EQ is the modern equivalent and behaves identically.

Tips

  • Use a table (Ctrl+T) so formulas auto-fill when you add rows, and sorting stays within the table.
  • To rank within groups (e.g., by department), use =COUNTIFS($A$2:$A$100,A2,$B$2:$B$100,">"&B2)+1 where A is the group column and B is the value column. This gives a rank within each group.
  • If you want to see the original order after sorting, add an index column (1,2,3…) before sorting, then you can re-sort by that column to restore.
  • For dynamic ranking that updates automatically, use the SORT and RANK.EQ combination in Excel 365, or simply re-apply the sort after changes.

Troubleshooting

  • Ranks look wrong after sorting. The RANK.EQ formula recalculates based on the range, which may have changed if you sorted only part of the data. Undo (Ctrl+Z) and re-select the entire range before sorting.
  • All ranks are 1. Check that your range reference is absolute and that the number being ranked is included in the range. A common error is ranking a cell outside the range.
  • #VALUE! error. The number argument may be text. Convert text numbers to real numbers using Text to Columns or VALUE().
  • Sort option greyed out. You may be in a protected sheet or editing a cell. Press Esc, then try Data > Sort again.
  • Helper column not updating. If you used a table, the formula should auto-fill. If not, drag the fill handle again or check that calculation is set to Automatic (Formulas > Calculation Options > Automatic).

Frequently Asked Questions

Can I rank without adding a helper column?

Not directly for sorting. You need a numeric rank value in a column to sort by. You can use a formula in a new column, then sort, then delete the column if desired.

What is the difference between RANK.EQ and RANK.AVG?

RANK.EQ gives tied values the same rank and skips subsequent ranks. RANK.AVG gives tied values the average rank (e.g., two 2nd places become 2.5 each). Use RANK.EQ for standard competition ranking.

How do I rank from lowest to highest?

Use 1 as the third argument in RANK.EQ: =RANK.EQ(B2,$B$2:$B$100,1). Then sort the rank column smallest to largest.

Can I rank text values?

RANK.EQ only works with numbers. For text, you would need a COUNTIF formula to count how many values are alphabetically before each item, or use sorting directly.

Why do my ranks have gaps after ties?

That is how RANK.EQ works by design. To eliminate gaps, add +COUNTIF($B$2:B2,B2)-1 to the formula as described in step 5.

Does sorting by rank change my original data?

Yes, sorting rearranges rows permanently. If you need the original order, copy the sheet first or add an index column before sorting.