title: Excel - find nth largest value based on criteria
body: <p>This is a kind of an extension to this problem: <a href="https://stackoverflow.com/questions/52312773/excel-sum-values-from-the-data-set-based-on-criteria">Excel - Sum values from the data set based on criteria</a></p>
  
  <p>I have a table like this:</p>
  
  <pre><code>Country Region    Code  Name of product Year   Value
  Sweden  Stockholm 52    Apple           1995   1000
  Sweden  Malmö     25    Pancake         1991   1500
  Sweden  Malmö     52    Apple           1992   2470
  Finland Helsinki  21    Candy           1987   2500
  Denmark Copenhagen 52   Apple           1987   2571
  </code></pre>
  
  <p>What I want to do is to make a code that can give me the sum of the nth largest value of products that have been sold in a specific country.</p>
  
  <p>That is, if I want to get the highest <code>value</code> for <code>products</code> sold in <code>Sweden</code> it should return <code>Apple</code> and the sum of sold apples, <code>3470</code>.</p>
  
  <p>edit: The solution of Glitch_Doctor:</p>
  
  <p><a href="https://i.stack.imgur.com/d0SO2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d0SO2.png" alt="enter image description here"></a></p>