Rank Excluding Text

adrienne0914

Board Regular
Joined
Mar 22, 2018
Messages
57
Office Version
  1. 2016
Platform
  1. Windows
I want to rank sales by location, but I want to exclude all origins from China, which is the country. I'm only interested in the activity from the city (lines 18-20, which display the desired results). With the formula as it is, it's considering everything. Is there a way to rank excluding China? Maybe RANK is the wrong formula...

Excel 2010
ABCDEFGH
1ORIGINDESTINATIONTRADE LANETERRITORYPARTYTOTALS Chicago
Sales
Chicago
Rank
2ChinaChicagoChina - ChicagoMid WestABATA64 64 16
3ChinaChicagoChina - ChicagoMid WestBLOGTAG1,039 1,039 -
4ChinaChicagoChina - ChicagoMid WestCOGIBOX901 901 -
5ChinaChicagoChina - ChicagoMid WestCAMIDO201 201 -
6ChinaChicagoChina - ChicagoMid WestDABJAM4 4 -
7ChinaChicagoChina - ChicagoMid WestDEMIZZ765 765 -
8ChinaChicagoChina - ChicagoMid WestDIVAPE470 470 -
9ChinaChicagoChina - ChicagoMid WestFANOODLE1,669 1,669 -
10ChinaChicagoChina - ChicagoMid WestGEBA39 39 -
11ChinaChicagoChina - ChicagoMid WestINNOJAM423 423 -
12ChinaChicagoChina - ChicagoMid WestJABBERBEAN12 12 -
13ChinaChicagoChina - ChicagoMid WestKAZU81 81 -
14ChinaChicagoChina - ChicagoMid WestPODCAT39 39 -
15ChinaChicagoChina - ChicagoMid WestSTUDZ510 510 -
16ChinaChicagoChina - ChicagoMid WestSUCKERZ344 344 -
17ChinaChicagoChina - ChicagoMid WestTOODLES156 156 -
18ShanghaiChicagoShanghai - ChicagoMid WestBLOGTAG334 334 1
19ShanghaiChicagoShanghai - ChicagoMid WestCOGIBOX32 32 5
20ShanghaiChicagoShanghai - ChicagoMid WestCAMIDO69 69 4
21ShanghaiChicagoShanghai - ChicagoMid WestDEMIZZ143 143 3
22ShanghaiChicagoShanghai - ChicagoMid WestFANOODLE14 14 6
23ShanghaiChicagoShanghai - ChicagoMid WestSUCKERZ182 182 2
24ShanghaiChicagoShanghai - ChicagoMid WestTOODLES2 2 7

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
H2=RANK(G2,G$2:G$24,0)+COUNTIF(G$2:G24,G24)-1

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

<tbody>
</tbody>
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Try ..

Excel Workbook
AGH
1ORIGINChicago salesChicago Rank
2China64-
3China1,039-
4China901-
5China201-
6China4-
7China765-
8China470-
9China1,669-
10China39-
11China423-
12China12-
13China81-
14China39-
15China510-
16China344-
17China156-
18Shanghai3341
19Shanghai325
20Shanghai694
21Shanghai1433
22Shanghai146
23Shanghai1822
24Shanghai27
Rank
 
Upvote 0
Try ..

Rank

AGH
1ORIGINChicago salesChicago Rank
2China64-
3China1,039-
4China901-
5China201-
6China4-
7China765-
8China470-
9China1,669-
10China39-
11China423-
12China12-
13China81-
14China39-
15China510-
16China344-
17China156-
18Shanghai3341
19Shanghai325
20Shanghai694
21Shanghai1433
22Shanghai146
23Shanghai1822
24Shanghai27

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:73px;"><col style="width:102px;"><col style="width:101px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
H2=IF(A2="China","-",SUMPRODUCT(($A$2:$A$24<>"China")*(G2<$G$2:$G$24))+1)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Peter, thank you so much. This worked GREAT!! I love this forum!!
 
Upvote 0
Peter, thank you so much. This worked GREAT!! I love this forum!!
You're welcome. Glad it worked for you. :)

BTW, best not to fully quote long posts as it makes the thread harder to read/navigate. If you want to quote, quote small, relevant parts only.
 
Upvote 0
Understood. I tried to just quote the formula that you provided, but it didn't work out. I'll get it together. Thanks! :)
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,687
Members
449,117
Latest member
Aaagu

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