title: Row number and partition in Excel
body: <p>I have data in excel such as:</p>
  
  <pre><code>ID        | Fee
  123456789 | 100
  987654321 | 100
  987654321 | 75
  987654321 | 50
  </code></pre>
  
  <p>I need to calculate a fee reduction for the items that are not the max price. The spreadsheet is sorted by ID, then Fee in the fashion needed. What I do not know how to do is use a similar row_number() over(partition by) in excel that I would normally do in SQL</p>
  
  <p>Desired output would be</p>
  
  <pre><code>ID        | Fee   | rn
  123456789 | 100   | 1
  987654321 | 100   | 1
  987654321 | 75    | 2
  987654321 | 50    | 3
  </code></pre>