Ranking Values with a nested Index+Match

MaxLut

New Member
Joined
Jan 12, 2015
Messages
16
I have a sheet with economic indicators in column A, countries in B, and annual values in C-Z, and in AA I have the average annual value for that indicator.

Indicators repeat for each country, and countries repeat for each indicator, so it looks like:

Exports....US
Exports....China
Imports....US
Imports....China

I'm making a condensed sheet with each indicator in column A (indicators not repeating this time), and rank in the rows (B1=1,C1=2 etc.)

I'm part-way there. I've got a formula that will return the name of the country with the highest average value for each economic indicator, but I can't figure out how to rank them instead of just finding the maximum(switching MAX with rank.avg or rank.eq gives me #N/A even though it's an array formula).

Here is my formula thus far:

{=INDEX(Sheet8!$B:$B,MATCH(MAX(INDEX(Sheet8!$AA:$AA,MATCH(1,IF(Sheet8!$A:$A=Sheet1!$A2,1)))),Sheet8!$AA:$AA))}

^^This returns the correct answer that the United States has the highest average value for that indicator^^

Also, I'm not sure if this formula is matching each indicator's maximum value, or if it's just matching that specific value's first occurrence in the entire sheet. Since my data is continuous (e.g. 128,833.35462.....), the values only occur once, but in the future if I were using discrete data (e.g. 1,2,3...), maybe this formula won't work?

Thanks for reading through all of this, I appreciate any input!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
The Large function should be able to handle what you want, it will just be a matter of figuring out how to set k.
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

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