Create a rank based on three fields in Excel

janetk411

New Member
Joined
Feb 7, 2019
Messages
15
[TABLE="width: 500"]
<tbody>[TR]
[TD]YEAR
[/TD]
[TD]CLIENT
[/TD]
[TD]STATION
[/TD]
[TD]STATIONCNT
[/TD]
[TD]STATIONCNT RANK
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019
[/TD]
[TD]A
[/TD]
[TD]CHI
[/TD]
[TD]8
[/TD]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019
[/TD]
[TD]A
[/TD]
[TD]LAX
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2018
[/TD]
[TD]A
[/TD]
[TD]DAL
[/TD]
[TD]7
[/TD]
[TD]3
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2018
[/TD]
[TD]A
[/TD]
[TD]SFA
[/TD]
[TD]25
[/TD]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2018
[/TD]
[TD]A
[/TD]
[TD]NYO
[/TD]
[TD]8
[/TD]
[TD]2
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2018
[/TD]
[TD]B
[/TD]
[TD]SFA
[/TD]
[TD]1
[/TD]
[TD]4
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2018
[/TD]
[TD]B
[/TD]
[TD]CHO
[/TD]
[TD]10
[/TD]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2018
[/TD]
[TD]B
[/TD]
[TD]CHI
[/TD]
[TD]4
[/TD]
[TD]2
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019
[/TD]
[TD]B
[/TD]
[TD]LAO
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019
[/TD]
[TD]B
[/TD]
[TD]LAX
[/TD]
[TD]23
[/TD]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2019
[/TD]
[TD]B
[/TD]
[TD]NYA
[/TD]
[TD]4
[/TD]
[TD]2
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I want to rank client file count by year by station.
I normally use SUMPRODUCT if there is only two fields (ie:CLIENT & STATIONCNT) but now have a third column, YEAR, that I need to include the ranking.... Can someone help me with this formula?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
The expected ranking should be as shown in my original post - STATIONCOUNT RANK.

A "station" represents a branch at my company.

My original spreadsheet contains thousands of lines. Each line represents the File Count, by Station, by client, by year

I have to create a report for my boss that shows the file count for each client, by year and top three stations that had the most file count for that client, for that year

So if I can rank the file count, by client by year, by station, I can easily identify the top three branches.

Does that make sense? I appreciate your assistance!
 
Upvote 0
Is this what you want?
=COUNTIFS(A:A,A2,B:B,B2,D:D,">"&D2)+1
 
Upvote 0
The formula you have provided COUNTS the STATIONCNT lines, I need to RANK the STATIONCNT amount based on the year and client code. So in the example in my original post, for client = A, STATIONCNT 25 is ranked as 1 since that is the highest for that client for that year, 8 is ranked as 2 and then 7 as 3. Thank you for your assistance.
 
Upvote 0
Which is exactly what the formula returns. :)
 
Upvote 0
ah hah... I see thank you.

Would you know how to create unique "rank". When the STATIONCNT is duplicated for the same client/year I am receiving duplicate ranks.
 
Upvote 0
How about
=COUNTIFS(A:A,A2,B:B,B2,D:D,">"&D2)+COUNTIFS(A$2:A2,A2,B$2:B2,B2,D$2:D2,D2)
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top