Practical Excel skills sharing: formula routines for ranking according to conditions
When it comes to ranking data in excel, the first thing that comes to mind is the rank function, but what if you want to rank the data according to conditions? Friends, are you confused all of a sudden? It seems that you have not heard of the function of ranking according to conditions. So today I will share with you a formula for ranking according to conditions in Excel. Let’s take a look!
Among the Excel functions, there are SUMIF that sums based on conditions, AVERAGEIF that calculates average based on conditions, and COUNTIF that counts based on conditions. In the latest version, there is even The MAXIFS function that finds the maximum value based on conditions and the MINIFS function that finds the minimum value based on conditions are provided. But there is no function that can rank by conditions.
However, problems such as ranking by conditions are indeed encountered in daily life. For example, the following problem is a typical representative of it:
We all You know that you can use the RANK function to get the ranking of a number in a set of numbers. In this example, the total ranking is obtained by using the formula =RANK(C2,$C$2:$C$19).
But what to do if you want to get the sales ranking of each store in the region? Do you need to use the RANK function to rank in each region?
Although this is also an idea, the low efficiency can be imagined. In fact, among the Excel functions, there is a function that can achieve ranking by conditions, which is SUMPRODUCT.
Before formally introducing the formula for ranking by conditions, let us first understand the operation principle of ranking by conditions.
Take store 10004 as an example. The regional ranking is 2 and the overall ranking is 10. As shown in the figure:
The reason for its regional ranking It is 2, which is easy to understand, because there are only six numbers in the same sales area (condition). Among these six numbers, only one number is greater than 56.55, which is 79.72, so its ranking in the area is 2.
The calculation principle of other rankings is the same. Thinking about it this way, achieving ranking by conditions actually involves two processes: judgment of conditions and judgment of size.
Write these two processes using formulas: $A$2:$A$19=A2 and $C$2:$C$19>C2
, you can understand this with examples Two parts.
Look at the first one first, $A$2:$A$19=A2
will get a set of logical values:
{TRUE;TRUE;TRUE; TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}
$C$2:$C$19>C2 will also get a set of logical values:
{FALSE;TRUE;TRUE;TRUE;TRUE ;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;TRUE}
=SUMPRODUCT(($A$2:$A$19=A2)*($C$2:$C$19>C2))
=SUMPRODUCT((condition area 1=condition 1)* (Conditional area 2=Conditional 2)* (Data area>data))
Related learning recommendations: excel tutorial
The above is the detailed content of Practical Excel skills sharing: formula routines for ranking according to conditions. For more information, please follow other related articles on the PHP Chinese website!

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools