Rank duplicate values with COUNTIFS

thisistyty

New Member
Joined
Jul 30, 2020
Messages
2
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
Hi experts,

I have a data set looking at 3 types of fruit, their order dates, and order cost. I want to rank the line items by earliest date. However, since some orders have the same order date, I get duplicate ranks (see two rows of Apples ranked as #4 in the attached image).

I am using a COUNTIFS function to rank the fruit. How can I adjust the formula to avoid duplicate rank values? Should I use something different from COUNTIFS? Is there a way to incorporate the order cost as a second differentiator to help solve this problem?

1596126962386.png
 

Some videos you may like

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,545
Office Version
  1. 365
Platform
  1. Windows
How about
=COUNTIFS($C:$C,C4,$D:$D,"<"&D4)+COUNTIFS(C$4:C4,C4,D$4:D4,D4)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,545
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,545
Office Version
  1. 365
Platform
  1. Windows
For future reference, while we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.


cross posted Rank duplicate values with COUNTIFS
 

Watch MrExcel Video

Forum statistics

Threads
1,114,665
Messages
5,549,307
Members
410,909
Latest member
aa42
Top