Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to conditionally sum numeric data in an Excel table using SUMIFS
  • How to sum a total in multiple Excel tables
  • How to create a Histogram in Excel
  • How to count table rows in Excel
  • Conditional Formatting Color Scales Examples in Excel

References

  • How to create dynamic named range with OFFSET in Excel
  • How to use Excel INDIRECT Function
  • How to get address of last cell in range in Excel
  • VLOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • MATCH function: Description, Usage, Syntax, Examples and Explanation

Data Validations

  • Data validation must not exist in list
  • Excel Data validation with conditional list
  • Excel Data validation don’t exceed total
  • Excel Data validation no punctuation
  • How To Create Drop-down List in Excel

Excel Rank if formula Example

by

This tutorials shows how to rank items in a list using one or more criteria in Excel.

To achieve this you can use the COUNTIFS function.

Formula

=COUNTIFS(criteria_range,criteria,values,">"&value)+1

Explanation

In the example shown, the formula in E5 is:

=COUNTIFS(groups,C5,scores,">"&D5)+1

where “groups” is the named range C5:C14, and “scores” is the named range D5:D14.

The result is a rank for each person in their own group. Note: although data is sorted by group in the screenshot, the formula will work fine with unsorted data.

How this formula works

Although Excel has a RANK function, there is no RANKIF function to perform a conditional rank. However, you can easily create a conditional RANK with the COUNTIFS function.

The COUNTIFS function can perform a conditional count using two or more criteria. Criteria are entered in range/criteria pairs. In this case, the first criteria restricts the count to the same group, using the named range “groups” (C5:C14):

=COUNTIFS(groups,C5)

By itself, this will return total group members in group “A”, which is 5.

The second criteria restricts the count to only scores greater than the “current score” from D5:

=COUNTIFS(groups,C5,scores,">"&D5)

The two criteria work together to count rows where the group is A and the score is higher. For the first name in the list (Hannah), there are no higher scores in group A, so COUNTIFS returns zero. In the next row (Edward), there are three scores in group A higher than 79, so COUNTIFS returns 3. And so on.

To get a proper rank, we simply add 1 to the number returned by COUNTIFS.

Reversing rank order

To reverse rank order and rank in order (i.e. smallest value is ranked #1) just use the less than operator (<) instead of greater than (>):

=COUNTIFS(groups,C5,scores,"<"&D5)+1

Instead of counting scores greater than D5, this version will count scores less than the value in D5, effectively reversing the rank order.

Post navigation

Previous Post:

DECIMAL function: Description, Usage, Syntax, Examples and Explanation

Next Post:

AVERAGE function: Description, Usage, Syntax, Examples and Explanation

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • OR function: Description, Usage, Syntax, Examples and Explanation
  • NOT function: Description, Usage, Syntax, Examples and Explanation
  • Return blank if in Excel
  • IF with wildcards in Excel
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Add months to date in Excel
  • DATE function: Description, Usage, Syntax, Examples and Explanation
  • How to Calculate Age in Excel
  • DAYS360 function: Description, Usage, Syntax, Examples and Explanation
  • TIMEVALUE function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • Map inputs to arbitrary values in Excel
  • If cell contains one of many things in Excel
  • Calculate conditional mode with criteria in Excel
  • How to randomly assign people to groups in Excel
  • Group times into unequal buckets in Excel

General

  • Count cells that contain errors in Excel
  • How to add sequential row numbers to a set of data in Excel
  • Zoom Worksheet in Excel
  • How to count total columns in range in Excel
  • Mark Workbook as Final in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning