title: Excel get info about maximum value in a variable defined range
body: <p>assume I have the following set of data :</p>
  <pre><code>ID CAT VAL
  
  a   a   4
  
  b   a   94
  
  c   b   5
  
  d   b   94
  
  e   c   2
  
  f   c   3
  </code></pre>
  <p>In Excel 2019 Pro get the maximum VAL of CAT=b using MAXIF(VAL,CAT=b) and I get 94. Now I want to get the ID of the corresponding value (i.e. ID=d), but I cannot use INDEX+MATCH since the maximum of CAT=a is also 94 and then I get ID=b which is not what I want.</p>
  <p>How to get around that??</p>
  <p>Thanks, many of them.</p>