RANK.AVG Function in Excel

Master the RANK.AVG function with examples and error solutions. Learn how to rank values with average ranking for ties in Excel and Google Sheets.

ExcelExcel
Google SheetsGoogle Sheets
statistical
intermediate
Syntax Preview
ExcelExcelGoogle SheetsGoogle Sheets
=RANK.AVG(number, ref, [order])
What is the RANK.AVG Function?
RANK.AVG Syntax and Parameters

RANK.AVG Examples

Basic Student Score Ranking

Rank student test scores from highest to lowest, with average ranking for tied scores

Result: 2.5 (for tied scores at 88)

Sales Performance Ranking

Rank sales representatives by quarterly revenue with descending order and fair tie handling

Result: 3.5 for $112,000 sales

Ranking by Lowest Cost (Ascending Order)

Rank suppliers by unit cost where lower cost receives better rank

Result: 2.5 for $13.75 suppliers

Olympic-Style Competition Ranking

Rank athletes with decimal scores using average ranking for ties, mirroring official Olympic procedures

Result: 2.5 for tied scores at 9.333

Dynamic Ranking with Named Ranges

Create flexible, maintainable ranking system using named ranges that update automatically

Result: Dynamic rank that updates as data changes

Converting Ranks to Percentiles

Calculate percentile rankings from RANK.AVG for standardized statistical analysis and reporting

Result: Percentile score between 0% and 100%

Common RANK.AVG Errors and Solutions

#VALUE!

RANK.AVG returns #VALUE! error

Cause:

The 'number' parameter contains non-numeric data such as text, blank cells, or error values. This also occurs if attempting to rank a cell containing text that looks like a number (text-formatted numbers) or when formulas in the ranked cell return errors.

Solution:

**Diagnostic Steps:** 1. **Verify data type:** Select the cell and check if it shows as text in the formula bar. Text-formatted numbers appear left-aligned by default. 2. **Use ISNUMBER test:** Create a helper column with `=ISNUMBER(B2)` to identify non-numeric cells. FALSE results indicate text or errors. 3. **Convert text to numbers:** Use the VALUE function: `=RANK.AVG(VALUE(B2), $B$2:$B$10, 0)` 4. **Handle errors gracefully:** Wrap in IFERROR to display friendly messages: `=IFERROR(RANK.AVG(B2,$B$2:$B$10,0),"N/A")` 5. **Clean imported data:** For data imported from external sources, use Text-to-Columns (Data tab > Text to Columns) to convert text-formatted numbers to proper numeric format. **Prevention:** - Apply Number formatting to columns before data entry - Use Data Validation to restrict input to numbers only - When importing data, explicitly convert text columns to numbers - Implement IFERROR wrappers in production formulas

Prevention:

Always validate data types before ranking. Use data validation (Data > Data Validation > Settings > Allow: Decimal) to restrict input to numbers only. This prevents user entry of text values that cause errors.

Frequency: 35% of RANK.AVG errors

Example:

#N/A

RANK.AVG returns #N/A error

Cause:

The value specified in the 'number' parameter doesn't exist anywhere in the 'ref' range. This commonly happens when ranking a value from one range against a different range, when using incorrect absolute references that exclude the ranked value, or after filtering/sorting operations that separate the value from its reference range.

Solution:

**Troubleshooting approach:** 1. **Verify value is in range:** Ensure the cell you're ranking is included in the reference range. If ranking B2, the range must include row 2 (e.g., $B$2:$B$100, not $B$3:$B$100). 2. **Check absolute references:** Confirm $ symbols are correctly placed. When copying formulas, the range shouldn't shift to exclude values. 3. **Test with COUNTIF:** Use `=COUNTIF($B$2:$B$10, B2)` to verify the value exists in the range. Result should be > 0. 4. **Handle with IF wrapper:** Prevent error display: `=IF(COUNTIF($B$2:$B$10,B2)>0, RANK.AVG(B2,$B$2:$B$10,0), "Not Found")` 5. **For cross-sheet scenarios:** Verify sheet names and ranges exist and are spelled correctly: `=RANK.AVG(Sheet1!B2, Sheet2!$B$2:$B$100, 0)` - confirm Sheet2 contains the value from Sheet1. **Common causes:** - Ranking external data against internal dataset - Formulas copied incorrectly, shifting the reference range - Filtered data where visible values aren't in the actual range - Rounding differences causing slight numerical mismatches

Prevention:

Always include the ranked value in the reference range. Use dynamic named ranges or Excel Tables that automatically adjust as data grows. For separate lookup and ranking ranges, use VLOOKUP or INDEX-MATCH to ensure synchronization.

Frequency: 25% of RANK.AVG errors

Example:

#REF!

RANK.AVG returns #REF! error

Cause:

The reference range has been deleted, moved, or is invalid. This occurs when rows or columns containing the ref parameter are deleted, when copying formulas to sheets where the referenced range doesn't exist, or when external workbook links are broken.

Solution:

**Recovery steps:** 1. **Immediate undo:** If you just deleted rows/columns, press Ctrl+Z to undo and restore the references. 2. **Rebuild formulas:** If undo isn't possible, manually recreate the formula with valid ranges: `=RANK.AVG(B2, $B$2:$B$50, 0)` 3. **Use named ranges for stability:** Instead of cell references, define named ranges (Formulas > Define Name): `=RANK.AVG(B2, SalesData, 0)` where SalesData is a named range. Named ranges survive row/column deletions better. 4. **Implement Excel Tables:** Convert your data to a table (Ctrl+T) and use structured references: `=RANK.AVG([@Score], Table1[Score], 0)` - table references adjust automatically when rows are deleted. 5. **For external workbook links:** Verify the source workbook is open and accessible. Use Edit Links (Data > Edit Links) to update or remove broken links. **Prevention strategies:** - Use named ranges for all critical data ranges - Convert data to Excel Tables before creating formulas - Avoid deleting rows/columns within active formula ranges - Document formula dependencies before major worksheet restructuring

Prevention:

Create named ranges (Insert > Name > Define) for all ranking data ranges. Named ranges are more resilient to worksheet changes. Use Excel Tables (Ctrl+T) which automatically adjust references when rows are inserted or deleted.

Frequency: 20% of RANK.AVG errors

Example:

Incorrect Rankings

Rankings appear incorrect, unexpected, or inverted

Cause:

Incorrect order parameter (using 0 when 1 is needed, or vice versa), relative references without $ signs causing the range to shift when formulas are copied, hidden or filtered rows affecting expectations, or misunderstanding of how RANK.AVG handles ties with decimal numbers.

Solution:

**Diagnostic checklist:** 1. **Verify order parameter:** - For sales, scores, ratings (higher is better): Use 0 or omit the parameter `=RANK.AVG(B2, $B$2:$B$100, 0)` or `=RANK.AVG(B2, $B$2:$B$100)` - For costs, times, errors (lower is better): Use 1 `=RANK.AVG(C2, $C$2:$C$100, 1)` 2. **Check absolute references:** Formula should use $B$2:$B$100, not B2:B100. Without $ signs, the range shifts when copied, causing incorrect rankings. 3. **Test with known values:** Create a simple test case with values 100, 200, 300 to verify order parameter is correct. 300 should rank 1 with order=0, or rank 3 with order=1. 4. **Filtered data considerations:** RANK.AVG always ranks against the entire range, not just visible cells. If data is filtered, ranks reflect the complete dataset, not the filtered subset. 5. **Understand decimal ranks:** RANK.AVG returns decimals for ties (e.g., 2.5, 5.0). This is correct behavior, not an error. If you need integers, use RANK.EQ instead. **Common mistakes:** - Sales ranked with order=1 shows lowest sales as rank 1 (inverted) - Costs ranked with order=0 shows highest cost as rank 1 (inverted) - Copying formulas without absolute references shifts the range - Expecting integer ranks but getting decimals due to ties

Prevention:

Always use absolute references ($B$2:$B$100) for the ref parameter. Test your ranking logic on a small subset before applying to full dataset. Document whether your metric uses descending (0) or ascending (1) ranking. Be explicit with the order parameter even when using the default.

Frequency: 20% of RANK.AVG errors

Example:

RANK.AVG Best Practices and Tips

Always Use Absolute References for Range

When ranking values in multiple cells, always use absolute references ($ symbols) for the ref parameter to prevent the range from shifting when copying formulas. Use `=RANK.AVG(B2, $B$2:$B$100, 0)` not `=RANK.AVG(B2, B2:B100, 0)`. This ensures every row compares against the same complete dataset, maintaining ranking consistency across your entire range.

Use Named Ranges for Better Maintainability

Create named ranges for your data (Formulas > Define Name) and reference them in RANK.AVG formulas. Instead of `=RANK.AVG(B2, $B$2:$B$100, 0)`, use `=RANK.AVG(B2, AllScores, 0)` where 'AllScores' is your named range. This makes formulas easier to read, prevents reference errors when reorganizing worksheets, and simplifies updates when data ranges change. Named ranges are particularly valuable in collaborative workbooks where multiple users might modify the structure.

Combine with COUNTIF for Percentile Calculations

Convert RANK.AVG to percentile scores using the formula: `=1-(RANK.AVG(B2,$B$2:$B$100,0)-1)/(COUNT($B$2:$B$100)-1)`. This transformation is essential for standardized reporting, academic transcripts, and statistical analysis. The formula normalizes ranks to a 0-1 scale (multiply by 100 for percentage), enabling comparison across different-sized datasets. Rank 1 becomes 100th percentile, while the lowest rank becomes approximately 0th percentile.

RANK.AVG vs RANK.EQ: Choose the Right Function

Use RANK.AVG when you need fair tie handling and statistical accuracy - ideal for competitions, academic grades, and performance evaluations where tied values must be treated identically. Use RANK.EQ when you need traditional ranking with gaps - better for prize allocation, discrete positions, or situations where integer ranks are required. The key difference: RANK.AVG returns decimal numbers (2.5, 5.0) while RANK.EQ returns integers (2, 2, then jumps to 4).

Handle Errors Gracefully with IFERROR

Wrap RANK.AVG in IFERROR to handle blank cells, missing values, or data errors gracefully, creating professional-looking reports and dashboards. Use `=IFERROR(RANK.AVG(B2,$B$2:$B$10,0),"N/A")` to display friendly messages instead of error codes like #VALUE! or #N/A. This is particularly important in automated reports, executive dashboards, or any user-facing spreadsheets where error codes reduce credibility and create confusion.

Dynamic Ranking with Excel Tables

Convert your data range to an Excel Table (Ctrl+T or Insert > Table) and use structured references in RANK.AVG formulas. As you add rows to the table, rankings automatically update without changing formulas: `=RANK.AVG([@Score], ScoreTable[Score], 0)`. The [@Score] notation references the current row's score, while ScoreTable[Score] references the entire Score column. This approach eliminates the need to manually update range references and prevents common errors when datasets grow.

RANK.AVG vs Related Functions
Advanced RANK.AVG Techniques

Need Help with RANK.AVG Function in Excel?

Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.

Example Excel formula:

Related Formulas

Excel LARGE Function

The LARGE function returns the k-th largest value from a dataset. Learn how to find top values, combine with other functions, and avoid common errors.

intermediate
statistical
ExcelExcel
Google SheetsSheets
Validated
PERCENTRANK.EXC in Excel

The PERCENTRANK.EXC function returns the percentile rank of a value in a dataset, excluding 0 and 1, ideal for statistical analysis and data comparison.

intermediate
statistical
ExcelExcel
Google SheetsSheets
Validated
RANK Function in Excel

The RANK function returns the rank of a number within a list. Learn to rank data in ascending or descending order with examples.

beginner
statistical
ExcelExcel
Google SheetsSheets
Validated
SMALL Function in Excel

Master the SMALL function to find the k-th smallest value in datasets. Learn syntax, examples, and error solutions for Excel and Google Sheets.

intermediate
statistical
ExcelExcel
Google SheetsSheets
Validated