krislopmar
New Member
Im trying to get the n largest value after a sum. For example, I have:
[pre]
[/pre]
Before I have always used lookup first and then a combination of Sum and Offset to find year to date values for a certain country, but now this is not possible as what I need is:
If cell A1 is February, I need a formula that first sums Jan + Feb for every country (up to 200) and then finds me the n largest of this sum results across all 200 countries in cell C5. Then in cell B5 I have to find the country that provided that amount. Cell A1 is variable and be from 1 to 12.
Any ideas will be hugely appreciated. Thanks a lot in advance!
[pre]
Code:
Jan Feb Mar Apr Jun Jul ...
Country 1 23 31 11 43 18 9
Country 2 40 55 21 18 7 24
Country 3 14 31 45 6 29 14
...
Before I have always used lookup first and then a combination of Sum and Offset to find year to date values for a certain country, but now this is not possible as what I need is:
If cell A1 is February, I need a formula that first sums Jan + Feb for every country (up to 200) and then finds me the n largest of this sum results across all 200 countries in cell C5. Then in cell B5 I have to find the country that provided that amount. Cell A1 is variable and be from 1 to 12.
Any ideas will be hugely appreciated. Thanks a lot in advance!