In Rank formula, please help with making address for the array dependant on vlookup formula

harshlath

New Member
Joined
Oct 8, 2014
Messages
2
Can you please help me with below:

RANK (Cell Reference e.g. A1, Array reference e.g. A1:A10)

Summary of Query: Need to derive row number in Array reference on basis of vlookup.

Details:
Basically I have list like below:

Country Agent Amount
India ABC 100
India DEF 200
China XYZ 20
China XXX 30
China YYY 40

- Every month, number of Agents in each country would vary e.g. in above list India has two agents, it might be three agents in next month
- I need to calculate Rank of each Agent in his country. Have made another table which is giving me Row Number for First and Last Agent in each country (table like below)
First Agent Last Agent
India 2 3
China 4 6

- So I want to create RANK formula in which Row number in Array reference is vlookup value from the table

Thanks a lot in advance
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Code:
=RANK($C2,INDIRECT("C"&VLOOKUP($A2,$G$1:$I$3,2,0)&":C"&VLOOKUP($A2,$G$1:$I$3,3,0)))

This assumes table 1 is in A1:C6 and table2 is in G1:I3
 
Upvote 0
To calculate the rank of the Agents for each country try


A
B
C
D
1
Country​
Agent​
Amount​
Rank​
2
India​
ABC​
100​
2​
3
India​
DEF​
200​
1​
4
China​
XYZ​
20​
3​
5
China​
XXX​
30​
2​
6
China​
YYY​
40​
1​

Formula in D2 copied down
=COUNTIFS($A$2:$A$100,A2,$C$2:$C$100,">"&C2)+1

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,215,945
Messages
6,127,861
Members
449,411
Latest member
adunn_23

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