Ranking Excel data within a group using 2 columns

delvin

New Member
Joined
Oct 12, 2019
Messages
2
Hi All,

I am looking to get a rank column as shown below using some rank functions.

We have to group all same locations and rank within the group.

Then, the lowest sales should get the first rank. If the sales are same, the rank should be given based on the second Column Amount.

For example, Sydney have sales as 1000 in two cases. So we checked Amount and given rank 2 to the entry that is having higher amount.

Basically, Sales in ascending and amount in descending order within a group(Same Location). you help is highly appreciated.

LocationSalesAmountRank
Sydney850100001
Sydney1000120002
Sydney1000110003
Canada5000500002
Canada4500450001
Canada5000350003

<tbody>
</tbody>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Welcome to the forum.

Try:

Excel 2012
ABCD
1LocationSalesAmountRank
2Sydney850100001
3Sydney1000120002
4Sydney1000110003
5Canada5000500002
6Canada4500450001
7Canada5000350003

<colgroup><col style="width: 25pxpx" https:="" www.mrexcel.com="" forum="" usertag.php?do="list&action=hash&hash=DAE7F5"" target="_blank"></colgroup><colgroup><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D2
=COUNTIFS(A:A,A2,B:B,"<"&B2)+COUNTIFS(A:A,A2,B:B,B2,C:C,">"&C2)+1

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,796
Members
449,095
Latest member
m_smith_solihull

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