Ranking data in Excel by criteria is essential for organizing large datasets efficiently—whether you’re sorting employees by performance, products by sales, or students by grades. The key tools are direct sorting (for simple ascending/descending orders) and formulas like INDEX-MATCH or SUMPRODUCT, which rank based on complex rules (e.g., “rank by date, then by score”). Here’s how to do it fast, from basic to advanced scenarios.

What You'll Need

  • A blank or existing Excel worksheet with your data—columns labeled (e.g., Name, Score, Date).
  • Excel’s built-in functions: SORT for basic ranking, INDEX + MATCH for custom conditions, and SUMPRODUCT for weighted rankings.
  • Optional: A helper column for intermediate calculations if sorting isn’t enough.
  • Knowledge of your sorting priority (e.g., “highest score first” vs. “oldest project first”).

Step-by-Step

  1. Sort by a single criterion (e.g., scores). Select the data range (e.g., drag from A1 to C100). Go to Home > Sort A to Z (ascending) or Sort Z to A (descending). For custom sort orders (e.g., numeric first, then alphabetic), use: Home > Sort > Custom Sort. Set the primary sort key (e.g., Score) and click OK. This sorts only that column. Note: Labels (e.g., column headers) are sorted too. To exclude them, include only data rows (e.g., rows 2 to 101) in your selection.
  2. Rank by criteria in a single column (e.g., rank students by score) using INDEX-MATCH. In a new column (e.g., Column E), enter: =RANK.EQ(B2, $B$2:$B$100, 0) where B2 is the score cell, and $B$2:$B$100 is the range to rank against. The 0 argument makes it descending; use 1 for ascending. Drag the formula down. Example: If scores 90, 85, 95 appear, their ranks will be 3, 2, 1. If ties occur: Use RANK.AVG (Excel 365+) instead to assign average ranks to ties.
  3. Rank with multiple criteria (e.g., rank by date first, then score) using SORT with multiple columns. Select your data range, then:
    1. Go to Home > Sort A to Z and click Options in the dropdown.
    2. In the Sort dialog, set the primary sort field (e.g., Column C = Date) and click Add Level.
    3. Enter the secondary sort (e.g., Column B = Score), then click OK. Excel will now sort by Date ascending, then Score descending.
    Pro tip: Use SORTBY (Excel 365) for dynamic ranking based on hidden formulas. For older Excel, create a helper column with conditional logic (e.g., =IF(B2>80, "High", "Low")) and sort by that column.
  4. Rank by weighted criteria (e.g., 50% date, 50% score) using SUMPRODUCT. In a new column, enter: =SUMPRODUCT(($B$2:$B$100=$B2)*1, ($C$2:$C$100=$C2)*50) + (1-SUMPRODUCT(($B$2:$B$100=$B2)*1))*$D$2 where:
    • $B2 = target score value (e.g., 90).
    • $C2 = target date value (e.g., 1/1/2023).
    • $D2 = score weight (e.g., 50 for date, 50 for score).
    Adjust the formula to sum weighted values (e.g., multiply scores by a factor like 2 for double weight).

Common Mistakes

  • Sorting headers as data: Labels (e.g., column names) are included in the sort. Exclude them by selecting only rows 2–N in your range or using SORTBY with a helper column that excludes headers.
  • Ranking with empty cells: Excel ignores blank cells in RANK.EQ. Use IFERROR to assign a default rank (e.g., =IFERROR(RANK.EQ(B2, $B$2:$B$100, 0), "NA")).
  • Ignoring data range scope: When using INDEX-MATCH, the range must include all values to rank. If your data is filtered, apply the formula to the visible range or use OFFSET to account for hidden rows.
  • Mixing ascending/descending logic: RANK.EQ defaults to descending. Use RANK.AVG(., 1) for ascending. Confuse these and your ranks will be reversed.
  • Formula errors in helper columns: Typos (e.g., missing parentheses) break SORTBY or weighted ranking. Test formulas in a separate cell before applying.

Tips

  • Use named ranges for complex rankings. Define ranges like Scores = $B$2:$B$100 and reference them in formulas (e.g., =RANK.EQ(B2, Scores, 0)) for clarity and reusability.
  • Freeze headers while sorting to keep column labels visible. In the Sort dialog (Step 3 above), check Freeze panes.
  • Conditional formatting can highlight top-ranked rows. Apply a gradient fill to the RANK.EQ column (e.g., top 5 scores) using Home > Conditional Formatting > New Rule > Use a formula....
  • Sort by text rankings (e.g., “A”, “B”, “Alpha”), but first convert to numbers. Use =VALUE(LEFT(B2,1))*100 + VALUE(RIGHT(B2,1))*10 + VALUE(MID(B2,2,1)) to rank “A1” > “B2” > “C3”.
  • Backup your data before applying complex formulas. Ranking formulas can’t be undone if errors are introduced.

Troubleshooting

  1. Formula returns #N/A. Check for:
    • Typo in the lookup value (e.g., $B$2 vs. $B2).
    • Data range excludes the lookup cell. Use OFFSET if rows are filtered: =RANK.EQ(B2, OFFSET($B$2, 0, 0, ROW($B$2)-ROW(B2)+1, COUNTA($B$2:$B$100)), 0).
    • Empty cells in the lookup range. Filter out blank rows or use IFERROR.
  2. Sorting not working. Try:
    1. Selecting only data cells (skip headers).
    2. Clicking Sort A to Z in the ribbon, then Options > Custom Sort to debug order.
    3. Restarting Excel to clear temporary glitches.
  3. RANK.EQ gives wrong ranks. Verify:
    • The range excludes duplicates (use UNIQUE function for Excel 365).
    • You’re not using RANK.EQ(B2, B2:B100, 0), which ranks against itself (result: rank 1).
  4. SUMPRODUCT fails for weighted ranking. Common errors:
    • Dividing by zero (e.g., target score = 0). Handle with IF(B2=0, 0, ...).
    • Incorrect weight percentages (e.g., 100% for date). Ensure weights sum to 100.

Frequently Asked Questions

How do I rank in Excel by date without sorting?

Use RANK.EQ with a custom date range. Replace $C$2:$C$100 with a range of dates (e.g., dates in Column D). To handle dates like 1/1/2023, ensure they’re in Excel’s date format (DD/MM/YYYY format).

Can I rank by multiple columns in Excel 2019?

Yes, but only with SORT (Step 3 above). For INDEX-MATCH or SUMPRODUCT, create helper columns with logic (e.g., =IF(B2>80, "High", "Low")) and sort by those columns.

Why does RANK.EQ return 0 for all values?

This happens if the lookup value isn’t in the range. Check for typos, hidden blank rows, or mismatched ranges (e.g., $B$2:$B$100 vs. $B$2:$B$5). Use COUNTIF to verify data presence.

How do I rank by percentages (e.g., sales growth)?

Use RANK.EQ directly on the percentage column. For example, if Column E is growth percentages, enter =RANK.EQ(E2, $E$2:$E$100, 0). To handle ties, use RANK.AVG.

What’s the fastest way to rank a large dataset?

For hundreds of rows:

  1. Use SORT (1–2 minutes).
  2. For custom ranking, use INDEX-MATCH with a named range (reduces errors).
  3. Avoid SUMPRODUCT for very large datasets (performance lags).
Test with a subset first.

How can I rank by conditional logic (e.g., “only rank scores > 80”)?

Create a helper column with =IF(B2>80, B2, "NA"), then rank the helper column. Replace "NA" with a value below your cutoff (e.g., -100) to exclude it.